Sıfırlanma sorunu
Gönderilme zamanı: Cum Oca 11, 2019 7:29 pm
Ek'te verdiğim eklenti map değişince resetleniyor. yardımcı olur musunuz ?
@Taha Demirbaş
@ShooTeR
@Fatih ~ EjderYa
@Taha Demirbaş
@ShooTeR
@Fatih ~ EjderYa
Kod: Tümünü seç
Sonuç
Eklenti derleme sonucu aşağıdaki gibidir;
AMX Mod X Compiler 1.8.3-dev+5079
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2013 AMX Mod X Team
//cstrike/addons/amxmodx/scripting/time_extended.sma(40) : error 017: undefined symbol "fvault_load"
//cstrike/addons/amxmodx/scripting/time_extended.sma(83) : warning 233: symbol "client_disconnect" is marked as deprecated: Use client_disconnected() instead.
1 Error.
Could not locate output file /cstrike/addons/amxmodx/plugins/time_extended.amx (compile failed).
Derleme esnasında hata ile karşılaşmadıysanız eklentinizin ismini ( time_extended.amxx ) WebFTP > addons>amxmodx>configs>plugins.ini dosyasının en altına yazıp aktif edebilir veya sonradan kaldırabilirsinizEklentinin işlevi nedir amxmodx yüklü olmadığı için bakamıyorum
Kod: Tümünü seç
#include <amxmodx>
#include <amxmisc>
#include <nvault>
#define PLUGIN "Played Time"
#define VERSION "1.3"
#define AUTHOR "Nationals"
/*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 const hostname[] = "TOP15 TIME"
new showpt;
new TotalPlayedTime[33];
stock ChatColor(const id, const input[], any:...)
{
new count = 1, players[32]
static msg[191]
vformat(msg, 190, input, 3)
replace_all(msg, 190, "!g", "^4")
replace_all(msg, 190, "!y", "^3")
replace_all(msg, 190, "!team", "^1")
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();
}
}
}
}
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR );
register_clcmd("say /onlinesurem", "handle_say");
register_concmd("amx_onlinesuresi", "admin_showptime", ADMIN_CVAR," <#Player Name> - Details about playedtime.");
register_clcmd("say /online15", "show_top15");
register_clcmd("say /onlinesuresi","show_top15");
//register_clcmd("say /suresifirla","suresifirla");
register_clcmd("say /serversuresifirla","swsuresifirla");
showpt = register_cvar("amx_pt_mod","1");
}
public handle_say(id)
{
static said[9]
read_argv(1, said, 8);
new hostname[64]
get_cvar_string("hostname",hostname,63)
static timep;
timep = get_user_time(id, 1) / 60;
new mhours[6]
get_time("%H",mhours,charsmax(mhours))
new hrs = str_to_num(mhours) + 7;
if ( get_cvar_num("amx_time_voice") )
{
new mhours[6], mmins[6], whours[32], wmins[32], wpm[6]
get_time("%H",mhours,charsmax(mhours))
get_time("%M",mmins,charsmax(mmins))
new mins = str_to_num(mmins)
new hrs = str_to_num(mhours) + 7;
if (mins)
num_to_word(mins,wmins,charsmax(wmins))
else
wmins[0] = 0
if (hrs < 12)
wpm = "am "
else
{
if (hrs > 12) hrs -= 12
wpm = "pm "
}
if (hrs)
num_to_word(hrs,whours,charsmax(whours))
else
whours = "twelve "
}
new ctime[64]
new yeni[64]
get_time("%M:%S",ctime,charsmax(ctime))
get_time("%H",yeni,charsmax(yeni))
if(hrs>=24)
{
hrs=hrs-24
}
switch(get_pcvar_num(showpt))
{
case 0: return PLUGIN_HANDLED;
case 1 :
{
ChatColor(id,"^4[%s] ^3:^3 %d Dakika%s Serverde bulunuyorsun. ",hostname, timep, timep == 1 ? "" : "dir");
#if defined NVAULT
ChatColor(id,"^4[%s] ^3:^3 Toplam Online Suren: %d Dakika%s. ",hostname, timep+TotalPlayedTime[id], timep+TotalPlayedTime[id] == 1 ? "" : "dir");
#endif
ChatColor(id,"^4[%s] ^3: Saat :^4 %d:%s",hostname, hrs, ctime);
}
case 2 :
{
set_hudmessage(255, 50, 50, 0.34, 0.50, 0, 6.0, 4.0, 0.1, 0.2, -1);
show_hudmessage(id, "[%s] %d Dakika%s Serverde bulunuyorsun^n[%s] Saat: %d:%s",hostname , timep, timep == 1 ? "" : "dir",hostname, hrs, ctime);
}
}
return PLUGIN_CONTINUE;
}
public admin_showptime(id,level,cid)
{
new hostname[64]
get_cvar_string("hostname",hostname,63)
if(!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED;
static arg[32];
read_argv(1, arg, 31);
new player = cmd_target(id, arg, 2);
if(!player)
return PLUGIN_HANDLED;
static name[32];
get_user_name(player, name, 31);
static timep;
timep = get_user_time(player, 1) / 60;
new mhours[6]
get_time("%H",mhours,charsmax(mhours))
new hrs = str_to_num(mhours) + 7;
if ( get_cvar_num("amx_time_voice") )
{
new mhours[6], mmins[6], whours[32], wmins[32], wpm[6]
get_time("%H",mhours,charsmax(mhours))
get_time("%M",mmins,charsmax(mmins))
new mins = str_to_num(mmins)
new hrs = str_to_num(mhours) + 7;
if (mins)
num_to_word(mins,wmins,charsmax(wmins))
else
wmins[0] = 0
if (hrs < 12)
wpm = "am "
else
{
if (hrs > 12) hrs -= 12
wpm = "pm "
}
if (hrs)
num_to_word(hrs,whours,charsmax(whours))
else
whours = "twelve "
}
new ctime[64]
new yeni[64]
get_time("%M:%S",ctime,charsmax(ctime))
get_time("%H",yeni,charsmax(yeni))
if(hrs>=24)
{
hrs=hrs-24
}
console_print(id, "-----------------------#%s Isimli Oyuncunun Online Sure Bilgileri#-----------------------",name);
console_print(id, "[%s] %s Isimli Oyuncu :%d Dakika%s Server'de Bulunuyor.",hostname, name, timep, timep == 1 ? "" : "dir");
#if defined NVAULT
console_print(id, "[%s] %s Isimli Oyuncunun TOPLAM Online Suresi: %d Dakika%s.",hostname, name, timep+TotalPlayedTime[player], timep == 1 ? "" : "dir"); // new
#endif
console_print(id, "[%s] Saat: %d:%s",hostname, hrs, ctime);
console_print(id, "-------------------------------------------------------------------------------------------");
return PLUGIN_HANDLED;
}
#if defined NVAULT
public client_disconnect(id)
{
TotalPlayedTime[id] = TotalPlayedTime[id] + (get_user_time(id)/60);
SaveTime(id, TotalPlayedTime[id]);
}
#endif
#if defined NVAULT
public client_putinserver(id)
{
TotalPlayedTime[id] = LoadTime(id);
}
#endif
#if defined NVAULT
public LoadTime( id )
{
new valut = nvault_open("Time_played")
new authip[33];
new vaultkey[64], vaultdata[64];
get_user_ip(id, authip, 32, 1);
format(vaultkey, 63, "TIMEPLAYED%s", authip);
nvault_get(valut, vaultkey, vaultdata, 63);
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(id, authip, 32, 1);
format(vaultkey, 63, "TIMEPLAYED%s", authip);
format(vaultdata, 63, "%d", PlayedTime);
nvault_set(valut, vaultkey, vaultdata);
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(valut, 0, get_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 i, count;
static sort[33][2], maxPlayers;
if(!maxPlayers) maxPlayers = get_maxplayers();
for(i=1;i<=maxPlayers;i++)
{
sort[count][0] = i;
sort[count][1] = TotalPlayedTime[i] + (get_user_time(i, 1) / 60);
count++;
}
SortCustom2D(sort,count,"stats_custom_compare");
new motd[1024], len
len = format(motd, 1023,"<body background=^"http://i.hizliresim.com/z3Zo84.jpg^"><font color=#FFB000><pre>")
len += format(motd[len], 1023-len,"%s %-22.22s %3s^n", "#", "Nick", "Online Suresi")
new players[32], num
get_players(players, num)
new b = clamp(count,0,15)
new name[32], player
for(new a = 0; a < b; a++)
{
player = sort[a][0]
get_user_name(player, name, 31)
len += format(motd[len], 1023-len,"%d %-22.22s %d^n", a+1, name, sort[a][1])
}
len += format(motd[len], 1023-len,"</body></font></pre>")
show_motd(id, motd ,"Zombie WarS Online Sure 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;
}
/*
public suresifirla(id){
ChatColor(id,"^4[%s] ^3: Online Suren Sifirlanmistir.",hostname);
TotalPlayedTime[id] = 0
return PLUGIN_HANDLED
}
*/
public swsuresifirla(id){
if(!access(id,ADMIN_LEVEL_E)) {
ChatColor(id,"^4[%s] ^3:^4Buna Hakkin Yok!",hostname)
return PLUGIN_HANDLED
}
ChatColor(id,"^4[%s] ^3: Serverdeki Herkezin Online Suresi Sifirlandi..!",hostname );
TotalPlayedTime[0] = 0
return PLUGIN_HANDLED
}