Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
plugin edit
#11
Cvar ayarı amx_pt_mod
Pluginde bir sorun göremedim? Fakat amx_pt_mod cvar ayarı 0 ise /onlinesurem yazınca otomatik olarak durduruyor ve bu sebeplede altta bir yazı çıkmıyor. Bu değeri 1 yapıp denersen sorun düzelir.
Reply
#12
mlhcnshn dateline='' Wrote: Cvar ayarı amx_pt_mod
Pluginde bir sorun göremedim? Fakat amx_pt_mod cvar ayarı 0 ise /onlinesurem yazınca otomatik olarak durduruyor ve bu sebeplede altta bir yazı çıkmıyor. Bu değeri 1 yapıp denersen sorun düzelir.
amx_pt_mod & amx_pt_mod 1 & amx_pt_mod 0 yazinca consolda hiçbirşey yazmıyor bi değişiklik olmuyor

- - - - - - - - - -

mlhcnshn dateline='' Wrote: Cvar ayarı amx_pt_mod
Pluginde bir sorun göremedim? Fakat amx_pt_mod cvar ayarı 0 ise /onlinesurem yazınca otomatik olarak durduruyor ve bu sebeplede altta bir yazı çıkmıyor. Bu değeri 1 yapıp denersen sorun düzelir.
amx_pt_mod & amx_pt_mod 1 & amx_pt_mod 0 yazinca consolda hiçbirşey yazmıyor bi değişiklik olmuyor
Reply
#13
Dediğim gibi pluginde bir problem yok. Sen yüklediğine emin misin? Bu plugin amx_pt_mod cvarı oluşturuyor. Plugini yüklediğinden, pluginin çalıştığından emin ol.

plugins.ini den pluginin sonuna debug yazabilirsin, eğer ki plugins.ini erişimin yoksa host sağlayıcından bunu isteyebilirsin böylelikle sunucu loglarında bir hata var ise pluginde görülür.
Reply
#14
Abılerım Acıl Plugının Ismını Nasıl degıstırım Kod Olarak Yazın Lutfen Abılerım CSP Mesela Klan Ismını Yazıcagım lutfen abı
Reply
#15
mlhcnshn dateline='' Wrote: Dediğim gibi pluginde bir problem yok. Sen yüklediğine emin misin? Bu plugin amx_pt_mod cvarı oluşturuyor. Plugini yüklediğinden, pluginin çalıştığından emin ol.

plugins.ini den pluginin sonuna debug yazabilirsin, eğer ki plugins.ini erişimin yoksa host sağlayıcından bunu isteyebilirsin böylelikle sunucu loglarında bir hata var ise pluginde görülür.
plugin çalışıyor diğer kodlar örnek olarak amx_onlinesuresi & /pttop15 çalışıyor ama /onlinesurem yani kendi online süreme bakamıyorum sadece o kod çalışmıyor onda bir hata var sanırım

- - - - - - - - - -

mlhcnshn dateline='' Wrote: Dediğim gibi pluginde bir problem yok. Sen yüklediğine emin misin? Bu plugin amx_pt_mod cvarı oluşturuyor. Plugini yüklediğinden, pluginin çalıştığından emin ol.

plugins.ini den pluginin sonuna debug yazabilirsin, eğer ki plugins.ini erişimin yoksa host sağlayıcından bunu isteyebilirsin böylelikle sunucu loglarında bir hata var ise pluginde görülür.
plugin çalışıyor diğer kodlar örnek olarak amx_onlinesuresi & /pttop15 çalışıyor ama /onlinesurem yani kendi online süreme bakamıyorum sadece o kod çalışmıyor onda bir hata var sanırım
Reply
#16
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <nvault>

#define PLUGIN "Played Time"
#define VERSION "1.3"
#define AUTHOR "Alka"

/*Comment this if you don't want to use nvault*/
#define NVAULT
/*Comment this line if you don't want to prune vlutdata*/
#define PRUNE
/*Prune time:ater x time of beeing inactive,remove valutdata*/
#define PRUNE_TIME 2592000 /*30 days*/ /*Time in seconds*/

new showpt;

new 
TotalPlayedTime[33];

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR );
    
    
register_clcmd("say""handle_say");
    
register_concmd("amx_onlinesuresi""admin_showptime"ADMIN_KICK," <#Player Name> - Details about playedtime.");
    
register_clcmd("say /pttop15""show_top15");
    
register_clcmd("say /onlinesuresi","show_top15");
    
    
showpt register_cvar("amx_pt_mod","1");
    
}

public 
handle_say(id)
{
    static 
said[13]
    
read_argv(1said12);
    new 
hostname[64]
    
get_cvar_string("hostname",hostname,63)
    if(
equali(said"/onlinesurem"))
    {
        static 
ctime[64], timep;
        
        
timep get_user_time(id1) / 60;
        
get_time("%H:%M:%S"ctime63);
        
        switch(
get_pcvar_num(showpt))
        {
            case 
0: return PLUGIN_HANDLED;
                
            case 
:
            {
                
client_print(idprint_chat"[%s] %d Dakika%s Serverde bulunuyorsun. ",hostnametimeptimep == "" "dir");
                
#if defined NVAULT 
                
client_print(idprint_chat"[%s] Toplam Online Suren: %d Dakika%s.",hostnametimep+TotalPlayedTime[id], timep+TotalPlayedTime[id] == "" "dir");
                
#endif
                
client_print(idprint_chat"[%s] Saat: %s",hostnamectime);
            }
            case 
:
            {
                
set_hudmessage(25550500.340.5006.04.00.10.2, -1);
                
show_hudmessage(id"[%s] %d Dakika%s Serverde bulunuyorsun^n[%s] Saat: %s",hostname timeptimep == "" "dir",hostnamectime);
            }
        }
        return 
PLUGIN_HANDLED;
    }
    return 
PLUGIN_CONTINUE;
}
public 
admin_showptime(id,level,cid
{
    new 
hostname[64]
    
get_cvar_string("hostname",hostname,63)
    if(!
cmd_access(idlevelcid2))
        return 
PLUGIN_HANDLED;
    
    static 
arg[32];
    
read_argv(1arg31);
    
    new 
player cmd_target(idarg2);
    
    if(!
player)
        return 
PLUGIN_HANDLED;
    
    static 
name[32];
    
get_user_name(playername31);
    
    static 
timepctime[64];
    
    
timep get_user_time(player1) / 60;
    
get_time("%H:%M:%S"ctime63);
    
    
console_print(id"-----------------------#%s Isimli Oyuncunun Online Sure Bilgileri#-----------------------",name);
    
console_print(id"[%s] %s Isimli Oyuncu :%d Dakika%s Server'de Bulunuyor.",hostnamenametimeptimep == "" "dir");
    
#if defined NVAULT
    
console_print(id"[%s] %s Isimli Oyuncunun TOPLAM Online Suresi: %d Dakika%s.",hostnamenametimep+TotalPlayedTime[player], timep == "" "dir"); // new
    #endif
    
console_print(id"[%s] Saat: %s",hostnamectime);
    
console_print(id"-------------------------------------------------------------------------------------------");
    
    return 
PLUGIN_HANDLED;
}

#if defined NVAULT
public client_disconnect(id)
{
    
TotalPlayedTime[id] = TotalPlayedTime[id] + (get_user_time(id)/60);
    
SaveTime(idTotalPlayedTime[id]);
}
#endif

#if defined NVAULT
public client_putinserver(id)
{
    
TotalPlayedTime[id] = LoadTime(id);
}
#endif

#if defined NVAULT
public LoadTimeid 
{
    new 
valut nvault_open("Time_played")
    
    new 
authip[33];
    new 
vaultkey[64], vaultdata[64];
    
    
get_user_ip(idauthip321);
    
    
format(vaultkey63"TIMEPLAYED%s"authip);
    
    
nvault_get(valutvaultkeyvaultdata63);
    
nvault_close(valut);
    
    return 
str_to_num(vaultdata);
}
#endif

#if defined NVAULT
public SaveTime(id,PlayedTime)
{
    new 
valut nvault_open("Time_played")
    
    if(
valut == INVALID_HANDLE)
        
set_fail_state("nValut returned invalid handle")
    
    new 
authip[33];
    new 
vaultkey[64], vaultdata[64];
    
    
get_user_ip(idauthip321);
    
    
format(vaultkey63"TIMEPLAYED%s"authip); 
    
format(vaultdata63"%d"PlayedTime); 
    
    
nvault_set(valutvaultkeyvaultdata);
    
nvault_close(valut);
}
#endif

#if defined PRUNE
public prune()
{
    new 
valut nvault_open("Time_played");
    
    if(
valut == INVALID_HANDLE)
        
set_fail_state("nValut returned invalid handle");
    
    
nvault_prune(valut0get_systime() - PRUNE_TIME);
    
nvault_close(valut);
}
#endif

#if defined PRUNE
public plugin_end()
{
    
prune()
}
#endif

#if defined PRUNE
public show_top15(id)
{
    new 
hostname[64]
    
get_cvar_string("hostname",hostname,63)
    new 
icount;
    static 
sort[33][2], maxPlayers;
    
    if(!
maxPlayersmaxPlayers get_maxplayers();
    
    for(
i=1;i<=maxPlayers;i++)
    {
        
sort[count][0] = i;
        
sort[count][1] = TotalPlayedTime[i] + (get_user_time(i1) / 60);
        
count++;
    }
    
    
SortCustom2D(sort,count,"stats_custom_compare");
    
    new 
motd[1024], len    
    
    len 
format(motd1023,"<body bgcolor=#000000><font color=#FFB000><pre>")
    
len += format(motd[len], 1023-len,"%s %-22.22s %3s^n""#""Nick""Online Suresi")
    
    new 
players[32], num
    get_players
(playersnum)
    
    new 
clamp(count,0,15)
    
    new 
name[32], player
    
    
for(new 0ba++)
    {
        
player sort[a][0]
        
        
get_user_name(playername31)        
        
len += format(motd[len], 1023-len,"%d %-22.22s %d^n"a+1namesort[a][1])
    }
    
    
len += format(motd[len], 1023-len,"</body></font></pre>")
    
show_motd(idmotd ,"Online Top 15")
    
    return 
PLUGIN_CONTINUE
}
#endif

public stats_custom_compare(elem1[],elem2[])
{
    if(
elem1[1] > elem2[1]) return -1;
    else if(
elem1[1] < elem2[1]) return 1;
        
    return 
0;


Büyük ihtimalle düzelir, al dene Smile[/i]
Reply
#17
mlhcnshn dateline='' Wrote:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <nvault>

#define PLUGIN "Played Time"
#define VERSION "1.3"
#define AUTHOR "Alka"

/*Comment this if you don't want to use nvault*/
#define NVAULT
/*Comment this line if you don't want to prune vlutdata*/
#define PRUNE
/*Prune time:ater x time of beeing inactive,remove valutdata*/
#define PRUNE_TIME 2592000 /*30 days*/ /*Time in seconds*/

new showpt;

new 
TotalPlayedTime[33];

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR );
    
    
register_clcmd("say""handle_say");
    
register_concmd("amx_onlinesuresi""admin_showptime"ADMIN_KICK," <#Player Name> - Details about playedtime.");
    
register_clcmd("say /pttop15""show_top15");
    
register_clcmd("say /onlinesuresi","show_top15");
    
    
showpt register_cvar("amx_pt_mod","1");
    
}

public 
handle_say(id)
{
    static 
said[13]
    
read_argv(1said12);
    new 
hostname[64]
    
get_cvar_string("hostname",hostname,63)
    if(
equali(said"/onlinesurem"))
    {
        static 
ctime[64], timep;
        
        
timep get_user_time(id1) / 60;
        
get_time("%H:%M:%S"ctime63);
        
        switch(
get_pcvar_num(showpt))
        {
            case 
0: return PLUGIN_HANDLED;
                
            case 
:
            {
                
client_print(idprint_chat"[%s] %d Dakika%s Serverde bulunuyorsun. ",hostnametimeptimep == "" "dir");
                
#if defined NVAULT 
                
client_print(idprint_chat"[%s] Toplam Online Suren: %d Dakika%s.",hostnametimep+TotalPlayedTime[id], timep+TotalPlayedTime[id] == "" "dir");
                
#endif
                
client_print(idprint_chat"[%s] Saat: %s",hostnamectime);
            }
            case 
:
            {
                
set_hudmessage(25550500.340.5006.04.00.10.2, -1);
                
show_hudmessage(id"[%s] %d Dakika%s Serverde bulunuyorsun^n[%s] Saat: %s",hostname timeptimep == "" "dir",hostnamectime);
            }
        }
        return 
PLUGIN_HANDLED;
    }
    return 
PLUGIN_CONTINUE;
}
public 
admin_showptime(id,level,cid
{
    new 
hostname[64]
    
get_cvar_string("hostname",hostname,63)
    if(!
cmd_access(idlevelcid2))
        return 
PLUGIN_HANDLED;
    
    static 
arg[32];
    
read_argv(1arg31);
    
    new 
player cmd_target(idarg2);
    
    if(!
player)
        return 
PLUGIN_HANDLED;
    
    static 
name[32];
    
get_user_name(playername31);
    
    static 
timepctime[64];
    
    
timep get_user_time(player1) / 60;
    
get_time("%H:%M:%S"ctime63);
    
    
console_print(id"-----------------------#%s Isimli Oyuncunun Online Sure Bilgileri#-----------------------",name);
    
console_print(id"[%s] %s Isimli Oyuncu :%d Dakika%s Server'de Bulunuyor.",hostnamenametimeptimep == "" "dir");
    
#if defined NVAULT
    
console_print(id"[%s] %s Isimli Oyuncunun TOPLAM Online Suresi: %d Dakika%s.",hostnamenametimep+TotalPlayedTime[player], timep == "" "dir"); // new
    #endif
    
console_print(id"[%s] Saat: %s",hostnamectime);
    
console_print(id"-------------------------------------------------------------------------------------------");
    
    return 
PLUGIN_HANDLED;
}

#if defined NVAULT
public client_disconnect(id)
{
    
TotalPlayedTime[id] = TotalPlayedTime[id] + (get_user_time(id)/60);
    
SaveTime(idTotalPlayedTime[id]);
}
#endif

#if defined NVAULT
public client_putinserver(id)
{
    
TotalPlayedTime[id] = LoadTime(id);
}
#endif

#if defined NVAULT
public LoadTimeid 
{
    new 
valut nvault_open("Time_played")
    
    new 
authip[33];
    new 
vaultkey[64], vaultdata[64];
    
    
get_user_ip(idauthip321);
    
    
format(vaultkey63"TIMEPLAYED%s"authip);
    
    
nvault_get(valutvaultkeyvaultdata63);
    
nvault_close(valut);
    
    return 
str_to_num(vaultdata);
}
#endif

#if defined NVAULT
public SaveTime(id,PlayedTime)
{
    new 
valut nvault_open("Time_played")
    
    if(
valut == INVALID_HANDLE)
        
set_fail_state("nValut returned invalid handle")
    
    new 
authip[33];
    new 
vaultkey[64], vaultdata[64];
    
    
get_user_ip(idauthip321);
    
    
format(vaultkey63"TIMEPLAYED%s"authip); 
    
format(vaultdata63"%d"PlayedTime); 
    
    
nvault_set(valutvaultkeyvaultdata);
    
nvault_close(valut);
}
#endif

#if defined PRUNE
public prune()
{
    new 
valut nvault_open("Time_played");
    
    if(
valut == INVALID_HANDLE)
        
set_fail_state("nValut returned invalid handle");
    
    
nvault_prune(valut0get_systime() - PRUNE_TIME);
    
nvault_close(valut);
}
#endif

#if defined PRUNE
public plugin_end()
{
    
prune()
}
#endif

#if defined PRUNE
public show_top15(id)
{
    new 
hostname[64]
    
get_cvar_string("hostname",hostname,63)
    new 
icount;
    static 
sort[33][2], maxPlayers;
    
    if(!
maxPlayersmaxPlayers get_maxplayers();
    
    for(
i=1;i<=maxPlayers;i++)
    {
        
sort[count][0] = i;
        
sort[count][1] = TotalPlayedTime[i] + (get_user_time(i1) / 60);
        
count++;
    }
    
    
SortCustom2D(sort,count,"stats_custom_compare");
    
    new 
motd[1024], len    
    
    len 
format(motd1023,"<body bgcolor=#000000><font color=#FFB000><pre>")
    
len += format(motd[len], 1023-len,"%s %-22.22s %3s^n""#""Nick""Online Suresi")
    
    new 
players[32], num
    get_players
(playersnum)
    
    new 
clamp(count,0,15)
    
    new 
name[32], player
    
    
for(new 0ba++)
    {
        
player sort[a][0]
        
        
get_user_name(playername31)        
        
len += format(motd[len], 1023-len,"%d %-22.22s %d^n"a+1namesort[a][1])
    }
    
    
len += format(motd[len], 1023-len,"</body></font></pre>")
    
show_motd(idmotd ,"Online Top 15")
    
    return 
PLUGIN_CONTINUE
}
#endif

public stats_custom_compare(elem1[],elem2[])
{
    if(
elem1[1] > elem2[1]) return -1;
    else if(
elem1[1] < elem2[1]) return 1;
        
    return 
0;


Büyük ihtimalle düzelir, al dene Smile

Plugin Çalıştı /Onlinesurem düzeldi çok teşekkür ederim. Bunu sıfırlamak icin bir kod varmı veya nasıl yapacağız biliyormusun ? birde konu çözülmüş isteklere taşınabilir.

- - - - - - - - - -

mlhcnshn dateline='' Wrote:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <nvault>

#define PLUGIN "Played Time"
#define VERSION "1.3"
#define AUTHOR "Alka"

/*Comment this if you don't want to use nvault*/
#define NVAULT
/*Comment this line if you don't want to prune vlutdata*/
#define PRUNE
/*Prune time:ater x time of beeing inactive,remove valutdata*/
#define PRUNE_TIME 2592000 /*30 days*/ /*Time in seconds*/

new showpt;

new 
TotalPlayedTime[33];

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR );
    
    
register_clcmd("say""handle_say");
    
register_concmd("amx_onlinesuresi""admin_showptime"ADMIN_KICK," <#Player Name> - Details about playedtime.");
    
register_clcmd("say /pttop15""show_top15");
    
register_clcmd("say /onlinesuresi","show_top15");
    
    
showpt register_cvar("amx_pt_mod","1");
    
}

public 
handle_say(id)
{
    static 
said[13]
    
read_argv(1said12);
    new 
hostname[64]
    
get_cvar_string("hostname",hostname,63)
    if(
equali(said"/onlinesurem"))
    {
        static 
ctime[64], timep;
        
        
timep get_user_time(id1) / 60;
        
get_time("%H:%M:%S"ctime63);
        
        switch(
get_pcvar_num(showpt))
        {
            case 
0: return PLUGIN_HANDLED;
                
            case 
:
            {
                
client_print(idprint_chat"[%s] %d Dakika%s Serverde bulunuyorsun. ",hostnametimeptimep == "" "dir");
                
#if defined NVAULT 
                
client_print(idprint_chat"[%s] Toplam Online Suren: %d Dakika%s.",hostnametimep+TotalPlayedTime[id], timep+TotalPlayedTime[id] == "" "dir");
                
#endif
                
client_print(idprint_chat"[%s] Saat: %s",hostnamectime);
            }
            case 
:
            {
                
set_hudmessage(25550500.340.5006.04.00.10.2, -1);
                
show_hudmessage(id"[%s] %d Dakika%s Serverde bulunuyorsun^n[%s] Saat: %s",hostname timeptimep == "" "dir",hostnamectime);
            }
        }
        return 
PLUGIN_HANDLED;
    }
    return 
PLUGIN_CONTINUE;
}
public 
admin_showptime(id,level,cid
{
    new 
hostname[64]
    
get_cvar_string("hostname",hostname,63)
    if(!
cmd_access(idlevelcid2))
        return 
PLUGIN_HANDLED;
    
    static 
arg[32];
    
read_argv(1arg31);
    
    new 
player cmd_target(idarg2);
    
    if(!
player)
        return 
PLUGIN_HANDLED;
    
    static 
name[32];
    
get_user_name(playername31);
    
    static 
timepctime[64];
    
    
timep get_user_time(player1) / 60;
    
get_time("%H:%M:%S"ctime63);
    
    
console_print(id"-----------------------#%s Isimli Oyuncunun Online Sure Bilgileri#-----------------------",name);
    
console_print(id"[%s] %s Isimli Oyuncu :%d Dakika%s Server'de Bulunuyor.",hostnamenametimeptimep == "" "dir");
    
#if defined NVAULT
    
console_print(id"[%s] %s Isimli Oyuncunun TOPLAM Online Suresi: %d Dakika%s.",hostnamenametimep+TotalPlayedTime[player], timep == "" "dir"); // new
    #endif
    
console_print(id"[%s] Saat: %s",hostnamectime);
    
console_print(id"-------------------------------------------------------------------------------------------");
    
    return 
PLUGIN_HANDLED;
}

#if defined NVAULT
public client_disconnect(id)
{
    
TotalPlayedTime[id] = TotalPlayedTime[id] + (get_user_time(id)/60);
    
SaveTime(idTotalPlayedTime[id]);
}
#endif

#if defined NVAULT
public client_putinserver(id)
{
    
TotalPlayedTime[id] = LoadTime(id);
}
#endif

#if defined NVAULT
public LoadTimeid 
{
    new 
valut nvault_open("Time_played")
    
    new 
authip[33];
    new 
vaultkey[64], vaultdata[64];
    
    
get_user_ip(idauthip321);
    
    
format(vaultkey63"TIMEPLAYED%s"authip);
    
    
nvault_get(valutvaultkeyvaultdata63);
    
nvault_close(valut);
    
    return 
str_to_num(vaultdata);
}
#endif

#if defined NVAULT
public SaveTime(id,PlayedTime)
{
    new 
valut nvault_open("Time_played")
    
    if(
valut == INVALID_HANDLE)
        
set_fail_state("nValut returned invalid handle")
    
    new 
authip[33];
    new 
vaultkey[64], vaultdata[64];
    
    
get_user_ip(idauthip321);
    
    
format(vaultkey63"TIMEPLAYED%s"authip); 
    
format(vaultdata63"%d"PlayedTime); 
    
    
nvault_set(valutvaultkeyvaultdata);
    
nvault_close(valut);
}
#endif

#if defined PRUNE
public prune()
{
    new 
valut nvault_open("Time_played");
    
    if(
valut == INVALID_HANDLE)
        
set_fail_state("nValut returned invalid handle");
    
    
nvault_prune(valut0get_systime() - PRUNE_TIME);
    
nvault_close(valut);
}
#endif

#if defined PRUNE
public plugin_end()
{
    
prune()
}
#endif

#if defined PRUNE
public show_top15(id)
{
    new 
hostname[64]
    
get_cvar_string("hostname",hostname,63)
    new 
icount;
    static 
sort[33][2], maxPlayers;
    
    if(!
maxPlayersmaxPlayers get_maxplayers();
    
    for(
i=1;i<=maxPlayers;i++)
    {
        
sort[count][0] = i;
        
sort[count][1] = TotalPlayedTime + (get_user_time(i1) / 60);
        
count++;
    }
    
    
SortCustom2D(sort,count,"stats_custom_compare");
    
    new 
motd[1024], len    
    
    len 
format(motd1023,"<body bgcolor=#000000><font color=#FFB000><pre>")
    
len += format(motd[len], 1023-len,"%s %-22.22s %3s^n""#""Nick""Online Suresi")
    
    new 
players[32], num
    get_players
(playersnum)
    
    new 
clamp(count,0,15)
    
    new 
name[32], player
    
    
for(new 0ba++)
    {
        
player sort[a][0]
        
        
get_user_name(playername31)        
        
len += format(motd[len], 1023-len,"%d %-22.22s %d^n"a+1namesort[a][1])
    }
    
    
len += format(motd[len], 1023-len,"</body></font></pre>")
    
show_motd(idmotd ,"Online Top 15")
    
    return 
PLUGIN_CONTINUE
}
#endif

public stats_custom_compare(elem1[],elem2[])
{
    if(
elem1[1] > elem2[1]) return -1;
    else if(
elem1[1] < elem2[1]) return 1;
        
    return 
0;


Büyük ihtimalle düzelir, al dene Smile

Plugin Çalıştı /Onlinesurem düzeldi çok teşekkür ederim. Bunu sıfırlamak icin bir kod varmı veya nasıl yapacağız biliyormusun ? birde konu çözülmüş isteklere taşınabilir.[/i][/i]
Reply
#18
mlhcnshn dateline='' Wrote:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <nvault>

#define PLUGIN "Played Time"
#define VERSION "1.3"
#define AUTHOR "Alka"

/*Comment this if you don't want to use nvault*/
#define NVAULT
/*Comment this line if you don't want to prune vlutdata*/
#define PRUNE
/*Prune time:ater x time of beeing inactive,remove valutdata*/
#define PRUNE_TIME 2592000 /*30 days*/ /*Time in seconds*/

new showpt;

new 
TotalPlayedTime[33];

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR );
    
    
register_clcmd("say""handle_say");
    
register_concmd("amx_onlinesuresi""admin_showptime"ADMIN_KICK," <#Player Name> - Details about playedtime.");
    
register_clcmd("say /pttop15""show_top15");
    
register_clcmd("say /onlinesuresi","show_top15");
    
    
showpt register_cvar("amx_pt_mod","1");
    
}

public 
handle_say(id)
{
    static 
said[13]
    
read_argv(1said12);
    new 
hostname[64]
    
get_cvar_string("hostname",hostname,63)
    if(
equali(said"/onlinesurem"))
    {
        static 
ctime[64], timep;
        
        
timep get_user_time(id1) / 60;
        
get_time("%H:%M:%S"ctime63);
        
        switch(
get_pcvar_num(showpt))
        {
            case 
0: return PLUGIN_HANDLED;
                
            case 
:
            {
                
client_print(idprint_chat"[%s] %d Dakika%s Serverde bulunuyorsun. ",hostnametimeptimep == "" "dir");
                
#if defined NVAULT 
                
client_print(idprint_chat"[%s] Toplam Online Suren: %d Dakika%s.",hostnametimep+TotalPlayedTime[id], timep+TotalPlayedTime[id] == "" "dir");
                
#endif
                
client_print(idprint_chat"[%s] Saat: %s",hostnamectime);
            }
            case 
:
            {
                
set_hudmessage(25550500.340.5006.04.00.10.2, -1);
                
show_hudmessage(id"[%s] %d Dakika%s Serverde bulunuyorsun^n[%s] Saat: %s",hostname timeptimep == "" "dir",hostnamectime);
            }
        }
        return 
PLUGIN_HANDLED;
    }
    return 
PLUGIN_CONTINUE;
}
public 
admin_showptime(id,level,cid
{
    new 
hostname[64]
    
get_cvar_string("hostname",hostname,63)
    if(!
cmd_access(idlevelcid2))
        return 
PLUGIN_HANDLED;
    
    static 
arg[32];
    
read_argv(1arg31);
    
    new 
player cmd_target(idarg2);
    
    if(!
player)
        return 
PLUGIN_HANDLED;
    
    static 
name[32];
    
get_user_name(playername31);
    
    static 
timepctime[64];
    
    
timep get_user_time(player1) / 60;
    
get_time("%H:%M:%S"ctime63);
    
    
console_print(id"-----------------------#%s Isimli Oyuncunun Online Sure Bilgileri#-----------------------",name);
    
console_print(id"[%s] %s Isimli Oyuncu :%d Dakika%s Server'de Bulunuyor.",hostnamenametimeptimep == "" "dir");
    
#if defined NVAULT
    
console_print(id"[%s] %s Isimli Oyuncunun TOPLAM Online Suresi: %d Dakika%s.",hostnamenametimep+TotalPlayedTime[player], timep == "" "dir"); // new
    #endif
    
console_print(id"[%s] Saat: %s",hostnamectime);
    
console_print(id"-------------------------------------------------------------------------------------------");
    
    return 
PLUGIN_HANDLED;
}

#if defined NVAULT
public client_disconnect(id)
{
    
TotalPlayedTime[id] = TotalPlayedTime[id] + (get_user_time(id)/60);
    
SaveTime(idTotalPlayedTime[id]);
}
#endif

#if defined NVAULT
public client_putinserver(id)
{
    
TotalPlayedTime[id] = LoadTime(id);
}
#endif

#if defined NVAULT
public LoadTimeid 
{
    new 
valut nvault_open("Time_played")
    
    new 
authip[33];
    new 
vaultkey[64], vaultdata[64];
    
    
get_user_ip(idauthip321);
    
    
format(vaultkey63"TIMEPLAYED%s"authip);
    
    
nvault_get(valutvaultkeyvaultdata63);
    
nvault_close(valut);
    
    return 
str_to_num(vaultdata);
}
#endif

#if defined NVAULT
public SaveTime(id,PlayedTime)
{
    new 
valut nvault_open("Time_played")
    
    if(
valut == INVALID_HANDLE)
        
set_fail_state("nValut returned invalid handle")
    
    new 
authip[33];
    new 
vaultkey[64], vaultdata[64];
    
    
get_user_ip(idauthip321);
    
    
format(vaultkey63"TIMEPLAYED%s"authip); 
    
format(vaultdata63"%d"PlayedTime); 
    
    
nvault_set(valutvaultkeyvaultdata);
    
nvault_close(valut);
}
#endif

#if defined PRUNE
public prune()
{
    new 
valut nvault_open("Time_played");
    
    if(
valut == INVALID_HANDLE)
        
set_fail_state("nValut returned invalid handle");
    
    
nvault_prune(valut0get_systime() - PRUNE_TIME);
    
nvault_close(valut);
}
#endif

#if defined PRUNE
public plugin_end()
{
    
prune()
}
#endif

#if defined PRUNE
public show_top15(id)
{
    new 
hostname[64]
    
get_cvar_string("hostname",hostname,63)
    new 
icount;
    static 
sort[33][2], maxPlayers;
    
    if(!
maxPlayersmaxPlayers get_maxplayers();
    
    for(
i=1;i<=maxPlayers;i++)
    {
        
sort[count][0] = i;
        
sort[count][1] = TotalPlayedTime[i] + (get_user_time(i1) / 60);
        
count++;
    }
    
    
SortCustom2D(sort,count,"stats_custom_compare");
    
    new 
motd[1024], len    
    
    len 
format(motd1023,"<body bgcolor=#000000><font color=#FFB000><pre>")
    
len += format(motd[len], 1023-len,"%s %-22.22s %3s^n""#""Nick""Online Suresi")
    
    new 
players[32], num
    get_players
(playersnum)
    
    new 
clamp(count,0,15)
    
    new 
name[32], player
    
    
for(new 0ba++)
    {
        
player sort[a][0]
        
        
get_user_name(playername31)        
        
len += format(motd[len], 1023-len,"%d %-22.22s %d^n"a+1namesort[a][1])
    }
    
    
len += format(motd[len], 1023-len,"</body></font></pre>")
    
show_motd(idmotd ,"Online Top 15")
    
    return 
PLUGIN_CONTINUE
}
#endif

public stats_custom_compare(elem1[],elem2[])
{
    if(
elem1[1] > elem2[1]) return -1;
    else if(
elem1[1] < elem2[1]) return 1;
        
    return 
0;


Büyük ihtimalle düzelir, al dene Smile


24 Saatte bir sıfırlanıyor toplam kaldığı onlinesüre onu nasıl ayarlıyacaz /pttop15 sıfırlanmıyo /onlinesurem 24 saatte bir sıfırlanıyor

- - - - - - - - - -

mlhcnshn dateline='' Wrote:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <nvault>

#define PLUGIN "Played Time"
#define VERSION "1.3"
#define AUTHOR "Alka"

/*Comment this if you don't want to use nvault*/
#define NVAULT
/*Comment this line if you don't want to prune vlutdata*/
#define PRUNE
/*Prune time:ater x time of beeing inactive,remove valutdata*/
#define PRUNE_TIME 2592000 /*30 days*/ /*Time in seconds*/

new showpt;

new 
TotalPlayedTime[33];

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR );
    
    
register_clcmd("say""handle_say");
    
register_concmd("amx_onlinesuresi""admin_showptime"ADMIN_KICK," <#Player Name> - Details about playedtime.");
    
register_clcmd("say /pttop15""show_top15");
    
register_clcmd("say /onlinesuresi","show_top15");
    
    
showpt register_cvar("amx_pt_mod","1");
    
}

public 
handle_say(id)
{
    static 
said[13]
    
read_argv(1said12);
    new 
hostname[64]
    
get_cvar_string("hostname",hostname,63)
    if(
equali(said"/onlinesurem"))
    {
        static 
ctime[64], timep;
        
        
timep get_user_time(id1) / 60;
        
get_time("%H:%M:%S"ctime63);
        
        switch(
get_pcvar_num(showpt))
        {
            case 
0: return PLUGIN_HANDLED;
                
            case 
:
            {
                
client_print(idprint_chat"[%s] %d Dakika%s Serverde bulunuyorsun. ",hostnametimeptimep == "" "dir");
                
#if defined NVAULT 
                
client_print(idprint_chat"[%s] Toplam Online Suren: %d Dakika%s.",hostnametimep+TotalPlayedTime[id], timep+TotalPlayedTime[id] == "" "dir");
                
#endif
                
client_print(idprint_chat"[%s] Saat: %s",hostnamectime);
            }
            case 
:
            {
                
set_hudmessage(25550500.340.5006.04.00.10.2, -1);
                
show_hudmessage(id"[%s] %d Dakika%s Serverde bulunuyorsun^n[%s] Saat: %s",hostname timeptimep == "" "dir",hostnamectime);
            }
        }
        return 
PLUGIN_HANDLED;
    }
    return 
PLUGIN_CONTINUE;
}
public 
admin_showptime(id,level,cid
{
    new 
hostname[64]
    
get_cvar_string("hostname",hostname,63)
    if(!
cmd_access(idlevelcid2))
        return 
PLUGIN_HANDLED;
    
    static 
arg[32];
    
read_argv(1arg31);
    
    new 
player cmd_target(idarg2);
    
    if(!
player)
        return 
PLUGIN_HANDLED;
    
    static 
name[32];
    
get_user_name(playername31);
    
    static 
timepctime[64];
    
    
timep get_user_time(player1) / 60;
    
get_time("%H:%M:%S"ctime63);
    
    
console_print(id"-----------------------#%s Isimli Oyuncunun Online Sure Bilgileri#-----------------------",name);
    
console_print(id"[%s] %s Isimli Oyuncu :%d Dakika%s Server'de Bulunuyor.",hostnamenametimeptimep == "" "dir");
    
#if defined NVAULT
    
console_print(id"[%s] %s Isimli Oyuncunun TOPLAM Online Suresi: %d Dakika%s.",hostnamenametimep+TotalPlayedTime[player], timep == "" "dir"); // new
    #endif
    
console_print(id"[%s] Saat: %s",hostnamectime);
    
console_print(id"-------------------------------------------------------------------------------------------");
    
    return 
PLUGIN_HANDLED;
}

#if defined NVAULT
public client_disconnect(id)
{
    
TotalPlayedTime[id] = TotalPlayedTime[id] + (get_user_time(id)/60);
    
SaveTime(idTotalPlayedTime[id]);
}
#endif

#if defined NVAULT
public client_putinserver(id)
{
    
TotalPlayedTime[id] = LoadTime(id);
}
#endif

#if defined NVAULT
public LoadTimeid 
{
    new 
valut nvault_open("Time_played")
    
    new 
authip[33];
    new 
vaultkey[64], vaultdata[64];
    
    
get_user_ip(idauthip321);
    
    
format(vaultkey63"TIMEPLAYED%s"authip);
    
    
nvault_get(valutvaultkeyvaultdata63);
    
nvault_close(valut);
    
    return 
str_to_num(vaultdata);
}
#endif

#if defined NVAULT
public SaveTime(id,PlayedTime)
{
    new 
valut nvault_open("Time_played")
    
    if(
valut == INVALID_HANDLE)
        
set_fail_state("nValut returned invalid handle")
    
    new 
authip[33];
    new 
vaultkey[64], vaultdata[64];
    
    
get_user_ip(idauthip321);
    
    
format(vaultkey63"TIMEPLAYED%s"authip); 
    
format(vaultdata63"%d"PlayedTime); 
    
    
nvault_set(valutvaultkeyvaultdata);
    
nvault_close(valut);
}
#endif

#if defined PRUNE
public prune()
{
    new 
valut nvault_open("Time_played");
    
    if(
valut == INVALID_HANDLE)
        
set_fail_state("nValut returned invalid handle");
    
    
nvault_prune(valut0get_systime() - PRUNE_TIME);
    
nvault_close(valut);
}
#endif

#if defined PRUNE
public plugin_end()
{
    
prune()
}
#endif

#if defined PRUNE
public show_top15(id)
{
    new 
hostname[64]
    
get_cvar_string("hostname",hostname,63)
    new 
icount;
    static 
sort[33][2], maxPlayers;
    
    if(!
maxPlayersmaxPlayers get_maxplayers();
    
    for(
i=1;i<=maxPlayers;i++)
    {
        
sort[count][0] = i;
        
sort[count][1] = TotalPlayedTime + (get_user_time(i1) / 60);
        
count++;
    }
    
    
SortCustom2D(sort,count,"stats_custom_compare");
    
    new 
motd[1024], len    
    
    len 
format(motd1023,"<body bgcolor=#000000><font color=#FFB000><pre>")
    
len += format(motd[len], 1023-len,"%s %-22.22s %3s^n""#""Nick""Online Suresi")
    
    new 
players[32], num
    get_players
(playersnum)
    
    new 
clamp(count,0,15)
    
    new 
name[32], player
    
    
for(new 0ba++)
    {
        
player sort[a][0]
        
        
get_user_name(playername31)        
        
len += format(motd[len], 1023-len,"%d %-22.22s %d^n"a+1namesort[a][1])
    }
    
    
len += format(motd[len], 1023-len,"</body></font></pre>")
    
show_motd(idmotd ,"Online Top 15")
    
    return 
PLUGIN_CONTINUE
}
#endif

public stats_custom_compare(elem1[],elem2[])
{
    if(
elem1[1] > elem2[1]) return -1;
    else if(
elem1[1] < elem2[1]) return 1;
        
    return 
0;


Büyük ihtimalle düzelir, al dene Smile


24 Saatte bir sıfırlanıyor toplam kaldığı onlinesüre onu nasıl ayarlıyacaz /pttop15 sıfırlanmıyo /onlinesurem 24 saatte bir sıfırlanıyor[/i][/i]
Reply
#19
mlhcnshn dateline='' Wrote:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <nvault>

#define PLUGIN "Played Time"
#define VERSION "1.3"
#define AUTHOR "Alka"

/*Comment this if you don't want to use nvault*/
#define NVAULT
/*Comment this line if you don't want to prune vlutdata*/
#define PRUNE
/*Prune time:ater x time of beeing inactive,remove valutdata*/
#define PRUNE_TIME 2592000 /*30 days*/ /*Time in seconds*/

new showpt;

new 
TotalPlayedTime[33];

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR );
    
    
register_clcmd("say""handle_say");
    
register_concmd("amx_onlinesuresi""admin_showptime"ADMIN_KICK," <#Player Name> - Details about playedtime.");
    
register_clcmd("say /pttop15""show_top15");
    
register_clcmd("say /onlinesuresi","show_top15");
    
    
showpt register_cvar("amx_pt_mod","1");
    
}

public 
handle_say(id)
{
    static 
said[13]
    
read_argv(1said12);
    new 
hostname[64]
    
get_cvar_string("hostname",hostname,63)
    if(
equali(said"/onlinesurem"))
    {
        static 
ctime[64], timep;
        
        
timep get_user_time(id1) / 60;
        
get_time("%H:%M:%S"ctime63);
        
        switch(
get_pcvar_num(showpt))
        {
            case 
0: return PLUGIN_HANDLED;
                
            case 
:
            {
                
client_print(idprint_chat"[%s] %d Dakika%s Serverde bulunuyorsun. ",hostnametimeptimep == "" "dir");
                
#if defined NVAULT 
                
client_print(idprint_chat"[%s] Toplam Online Suren: %d Dakika%s.",hostnametimep+TotalPlayedTime[id], timep+TotalPlayedTime[id] == "" "dir");
                
#endif
                
client_print(idprint_chat"[%s] Saat: %s",hostnamectime);
            }
            case 
:
            {
                
set_hudmessage(25550500.340.5006.04.00.10.2, -1);
                
show_hudmessage(id"[%s] %d Dakika%s Serverde bulunuyorsun^n[%s] Saat: %s",hostname timeptimep == "" "dir",hostnamectime);
            }
        }
        return 
PLUGIN_HANDLED;
    }
    return 
PLUGIN_CONTINUE;
}
public 
admin_showptime(id,level,cid
{
    new 
hostname[64]
    
get_cvar_string("hostname",hostname,63)
    if(!
cmd_access(idlevelcid2))
        return 
PLUGIN_HANDLED;
    
    static 
arg[32];
    
read_argv(1arg31);
    
    new 
player cmd_target(idarg2);
    
    if(!
player)
        return 
PLUGIN_HANDLED;
    
    static 
name[32];
    
get_user_name(playername31);
    
    static 
timepctime[64];
    
    
timep get_user_time(player1) / 60;
    
get_time("%H:%M:%S"ctime63);
    
    
console_print(id"-----------------------#%s Isimli Oyuncunun Online Sure Bilgileri#-----------------------",name);
    
console_print(id"[%s] %s Isimli Oyuncu :%d Dakika%s Server'de Bulunuyor.",hostnamenametimeptimep == "" "dir");
    
#if defined NVAULT
    
console_print(id"[%s] %s Isimli Oyuncunun TOPLAM Online Suresi: %d Dakika%s.",hostnamenametimep+TotalPlayedTime[player], timep == "" "dir"); // new
    #endif
    
console_print(id"[%s] Saat: %s",hostnamectime);
    
console_print(id"-------------------------------------------------------------------------------------------");
    
    return 
PLUGIN_HANDLED;
}

#if defined NVAULT
public client_disconnect(id)
{
    
TotalPlayedTime[id] = TotalPlayedTime[id] + (get_user_time(id)/60);
    
SaveTime(idTotalPlayedTime[id]);
}
#endif

#if defined NVAULT
public client_putinserver(id)
{
    
TotalPlayedTime[id] = LoadTime(id);
}
#endif

#if defined NVAULT
public LoadTimeid 
{
    new 
valut nvault_open("Time_played")
    
    new 
authip[33];
    new 
vaultkey[64], vaultdata[64];
    
    
get_user_ip(idauthip321);
    
    
format(vaultkey63"TIMEPLAYED%s"authip);
    
    
nvault_get(valutvaultkeyvaultdata63);
    
nvault_close(valut);
    
    return 
str_to_num(vaultdata);
}
#endif

#if defined NVAULT
public SaveTime(id,PlayedTime)
{
    new 
valut nvault_open("Time_played")
    
    if(
valut == INVALID_HANDLE)
        
set_fail_state("nValut returned invalid handle")
    
    new 
authip[33];
    new 
vaultkey[64], vaultdata[64];
    
    
get_user_ip(idauthip321);
    
    
format(vaultkey63"TIMEPLAYED%s"authip); 
    
format(vaultdata63"%d"PlayedTime); 
    
    
nvault_set(valutvaultkeyvaultdata);
    
nvault_close(valut);
}
#endif

#if defined PRUNE
public prune()
{
    new 
valut nvault_open("Time_played");
    
    if(
valut == INVALID_HANDLE)
        
set_fail_state("nValut returned invalid handle");
    
    
nvault_prune(valut0get_systime() - PRUNE_TIME);
    
nvault_close(valut);
}
#endif

#if defined PRUNE
public plugin_end()
{
    
prune()
}
#endif

#if defined PRUNE
public show_top15(id)
{
    new 
hostname[64]
    
get_cvar_string("hostname",hostname,63)
    new 
icount;
    static 
sort[33][2], maxPlayers;
    
    if(!
maxPlayersmaxPlayers get_maxplayers();
    
    for(
i=1;i<=maxPlayers;i++)
    {
        
sort[count][0] = i;
        
sort[count][1] = TotalPlayedTime[i] + (get_user_time(i1) / 60);
        
count++;
    }
    
    
SortCustom2D(sort,count,"stats_custom_compare");
    
    new 
motd[1024], len    
    
    len 
format(motd1023,"<body bgcolor=#000000><font color=#FFB000><pre>")
    
len += format(motd[len], 1023-len,"%s %-22.22s %3s^n""#""Nick""Online Suresi")
    
    new 
players[32], num
    get_players
(playersnum)
    
    new 
clamp(count,0,15)
    
    new 
name[32], player
    
    
for(new 0ba++)
    {
        
player sort[a][0]
        
        
get_user_name(playername31)        
        
len += format(motd[len], 1023-len,"%d %-22.22s %d^n"a+1namesort[a][1])
    }
    
    
len += format(motd[len], 1023-len,"</body></font></pre>")
    
show_motd(idmotd ,"Online Top 15")
    
    return 
PLUGIN_CONTINUE
}
#endif

public stats_custom_compare(elem1[],elem2[])
{
    if(
elem1[1] > elem2[1]) return -1;
    else if(
elem1[1] < elem2[1]) return 1;
        
    return 
0;


Büyük ihtimalle düzelir, al dene Smile


plugin 24 saatte bir sıfırlanıyor nasıl düzelticez onu 7 gün yapabilirmisin

- - - - - - - - - -

mlhcnshn dateline='' Wrote:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <nvault>

#define PLUGIN "Played Time"
#define VERSION "1.3"
#define AUTHOR "Alka"

/*Comment this if you don't want to use nvault*/
#define NVAULT
/*Comment this line if you don't want to prune vlutdata*/
#define PRUNE
/*Prune time:ater x time of beeing inactive,remove valutdata*/
#define PRUNE_TIME 2592000 /*30 days*/ /*Time in seconds*/

new showpt;

new 
TotalPlayedTime[33];

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR );
    
    
register_clcmd("say""handle_say");
    
register_concmd("amx_onlinesuresi""admin_showptime"ADMIN_KICK," <#Player Name> - Details about playedtime.");
    
register_clcmd("say /pttop15""show_top15");
    
register_clcmd("say /onlinesuresi","show_top15");
    
    
showpt register_cvar("amx_pt_mod","1");
    
}

public 
handle_say(id)
{
    static 
said[13]
    
read_argv(1said12);
    new 
hostname[64]
    
get_cvar_string("hostname",hostname,63)
    if(
equali(said"/onlinesurem"))
    {
        static 
ctime[64], timep;
        
        
timep get_user_time(id1) / 60;
        
get_time("%H:%M:%S"ctime63);
        
        switch(
get_pcvar_num(showpt))
        {
            case 
0: return PLUGIN_HANDLED;
                
            case 
:
            {
                
client_print(idprint_chat"[%s] %d Dakika%s Serverde bulunuyorsun. ",hostnametimeptimep == "" "dir");
                
#if defined NVAULT 
                
client_print(idprint_chat"[%s] Toplam Online Suren: %d Dakika%s.",hostnametimep+TotalPlayedTime[id], timep+TotalPlayedTime[id] == "" "dir");
                
#endif
                
client_print(idprint_chat"[%s] Saat: %s",hostnamectime);
            }
            case 
:
            {
                
set_hudmessage(25550500.340.5006.04.00.10.2, -1);
                
show_hudmessage(id"[%s] %d Dakika%s Serverde bulunuyorsun^n[%s] Saat: %s",hostname timeptimep == "" "dir",hostnamectime);
            }
        }
        return 
PLUGIN_HANDLED;
    }
    return 
PLUGIN_CONTINUE;
}
public 
admin_showptime(id,level,cid
{
    new 
hostname[64]
    
get_cvar_string("hostname",hostname,63)
    if(!
cmd_access(idlevelcid2))
        return 
PLUGIN_HANDLED;
    
    static 
arg[32];
    
read_argv(1arg31);
    
    new 
player cmd_target(idarg2);
    
    if(!
player)
        return 
PLUGIN_HANDLED;
    
    static 
name[32];
    
get_user_name(playername31);
    
    static 
timepctime[64];
    
    
timep get_user_time(player1) / 60;
    
get_time("%H:%M:%S"ctime63);
    
    
console_print(id"-----------------------#%s Isimli Oyuncunun Online Sure Bilgileri#-----------------------",name);
    
console_print(id"[%s] %s Isimli Oyuncu :%d Dakika%s Server'de Bulunuyor.",hostnamenametimeptimep == "" "dir");
    
#if defined NVAULT
    
console_print(id"[%s] %s Isimli Oyuncunun TOPLAM Online Suresi: %d Dakika%s.",hostnamenametimep+TotalPlayedTime[player], timep == "" "dir"); // new
    #endif
    
console_print(id"[%s] Saat: %s",hostnamectime);
    
console_print(id"-------------------------------------------------------------------------------------------");
    
    return 
PLUGIN_HANDLED;
}

#if defined NVAULT
public client_disconnect(id)
{
    
TotalPlayedTime[id] = TotalPlayedTime[id] + (get_user_time(id)/60);
    
SaveTime(idTotalPlayedTime[id]);
}
#endif

#if defined NVAULT
public client_putinserver(id)
{
    
TotalPlayedTime[id] = LoadTime(id);
}
#endif

#if defined NVAULT
public LoadTimeid 
{
    new 
valut nvault_open("Time_played")
    
    new 
authip[33];
    new 
vaultkey[64], vaultdata[64];
    
    
get_user_ip(idauthip321);
    
    
format(vaultkey63"TIMEPLAYED%s"authip);
    
    
nvault_get(valutvaultkeyvaultdata63);
    
nvault_close(valut);
    
    return 
str_to_num(vaultdata);
}
#endif

#if defined NVAULT
public SaveTime(id,PlayedTime)
{
    new 
valut nvault_open("Time_played")
    
    if(
valut == INVALID_HANDLE)
        
set_fail_state("nValut returned invalid handle")
    
    new 
authip[33];
    new 
vaultkey[64], vaultdata[64];
    
    
get_user_ip(idauthip321);
    
    
format(vaultkey63"TIMEPLAYED%s"authip); 
    
format(vaultdata63"%d"PlayedTime); 
    
    
nvault_set(valutvaultkeyvaultdata);
    
nvault_close(valut);
}
#endif

#if defined PRUNE
public prune()
{
    new 
valut nvault_open("Time_played");
    
    if(
valut == INVALID_HANDLE)
        
set_fail_state("nValut returned invalid handle");
    
    
nvault_prune(valut0get_systime() - PRUNE_TIME);
    
nvault_close(valut);
}
#endif

#if defined PRUNE
public plugin_end()
{
    
prune()
}
#endif

#if defined PRUNE
public show_top15(id)
{
    new 
hostname[64]
    
get_cvar_string("hostname",hostname,63)
    new 
icount;
    static 
sort[33][2], maxPlayers;
    
    if(!
maxPlayersmaxPlayers get_maxplayers();
    
    for(
i=1;i<=maxPlayers;i++)
    {
        
sort[count][0] = i;
        
sort[count][1] = TotalPlayedTime + (get_user_time(i1) / 60);
        
count++;
    }
    
    
SortCustom2D(sort,count,"stats_custom_compare");
    
    new 
motd[1024], len    
    
    len 
format(motd1023,"<body bgcolor=#000000><font color=#FFB000><pre>")
    
len += format(motd[len], 1023-len,"%s %-22.22s %3s^n""#""Nick""Online Suresi")
    
    new 
players[32], num
    get_players
(playersnum)
    
    new 
clamp(count,0,15)
    
    new 
name[32], player
    
    
for(new 0ba++)
    {
        
player sort[a][0]
        
        
get_user_name(playername31)        
        
len += format(motd[len], 1023-len,"%d %-22.22s %d^n"a+1namesort[a][1])
    }
    
    
len += format(motd[len], 1023-len,"</body></font></pre>")
    
show_motd(idmotd ,"Online Top 15")
    
    return 
PLUGIN_CONTINUE
}
#endif

public stats_custom_compare(elem1[],elem2[])
{
    if(
elem1[1] > elem2[1]) return -1;
    else if(
elem1[1] < elem2[1]) return 1;
        
    return 
0;


Büyük ihtimalle düzelir, al dene Smile


plugin 24 saatte bir sıfırlanıyor nasıl düzelticez onu 7 gün yapabilirmisin[/i][/i]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Vıp Plugın nihat331333 17 9,486 27-05-20, 08:57
Last Post: duzceli
  Takim Skor Plugin chirkinqral 5 10,140 02-02-18, 21:06
Last Post: fenakoyar
  Jail Plugin (İSTEK) mehmet154 6 6,826 09-12-17, 04:31
Last Post: exelds78
  WebSiteBot plugini edit mahmutt159 21 10,578 09-12-17, 04:30
Last Post: exelds78
  [EDİT] Banka Plugini pandora158 9 12,130 09-12-17, 04:28
Last Post: exelds78
  Basit plugin isteği MaMiBey 4 3,222 09-12-17, 04:11
Last Post: exelds78
  Nicke Özel Plugin 2 afaik61 3 5,719 09-12-17, 04:10
Last Post: exelds78
  T shop plugın [içeri] oguzhan22 3 4,143 07-06-17, 14:50
Last Post: farakk
  shop pluginine edit sallyreer 3 2,953 09-01-17, 21:11
Last Post: crunch98
  Base builder plugin sorunu acil Copyz 2 8,962 09-01-17, 21:09
Last Post: crunch98

Foruma Atla:


Users browsing this thread: 1 Guest(s)