Das waren mal meine Anfänge zu diesem Thema:
Code:
#include <core>
#include <console>
#include <string>
#include <admin>
#include <adminlib>
#define ACCESS_CONSOLE 131072
#define ACCESS_BAN 256
new STRING_VERSION[MAX_DATA_LENGTH] = "1.0";
new checktime = 0;
new GameCommencing=0;
new origtimelimit=0;
new show = 0;
new time;
public welt2(HLCommand,HLData,HLUserName,UserIndex)
{
new Data [MAX_DATA_LENGTH];
new x [MAX_DATA_LENGTH];
new dummy[MAX_DATA_LENGTH];
convert_string( HLData, Data, MAX_DATA_LENGTH );
strsplit(Data,"_",x,MAX_DATA_LENGTH,dummy,MAX_DATA_LENGTH);
if(strcmp(x,"Game")==0 && GameCommencing == 0)
{
GameCommencing = 1;
origtimelimit =getvar("mp_timelimit")*60;
checktime = systemtime();
set_timer("timecheck",1,99999);
}
else if(strcmp(x,"Restart")==0)
{
origtimelimit =getvar("mp_timelimit")*60;
checktime = systemtime();
}
return PLUGIN_HANDLED;
}
public timecheck(Timer,Repeat,HLName,HLParam)
{
new checkthetime;
if (getvar("mp_timelimit")*60 != origtimelimit)
{
checktime = systemtime()-(systemtime()- checktime);
origtimelimit= getvar("mp_timelimit")*60;
}
checkthetime = (origtimelimit-(systemtime()-checktime));
time=checkthetime;
if (show == 0)
{
show = 1;
set_timer("timeshow",60,1);
}
return PLUGIN_CONTINUE;
}
public timeshow(Timer,Repeat,HLName,HLParam)
{
new Msg[MAX_TEXT_LENGTH];
snprintf( Msg, MAX_TEXT_LENGTH, "mp_timeleft %d", time/60 );
exec(Msg);
show = 0;
return PLUGIN_CONTINUE;
}
public plugin_init()
{
plugin_registerinfo("Ein Timeremember auf LogD-Basis","",STRING_VERSION);
plugin_registercmd("welt2", "welt2", ACCESS_CONSOLE);
new Msg[MAX_DATA_LENGTH];
new Msg1[MAX_DATA_LENGTH];
new Map[MAX_TEXT_LENGTH];
/*nextmap(Map,MAX_TEXT_LENGTH);
snprintf(Msg1,MAX_DATA_LENGTH,"<-[LBCC]-Clanserver->||<-Nextmap->%s",Map);
snprintf(Msg,MAX_DATA_LENGTH,"hostname %s",Msg1);
exec(Msg);*/
exec("logd_reg 62 admin_command welt2");
return PLUGIN_CONTINUE;
}
Ist aber nicht ausgereift.
Das Timeleft wird in HLSW minütlich aktualisiert und erhält den Wert ab einem Game_Commencing, also wenn 2 Spieler auf dem Rechner sind. Einer T der andere CT.
_________________
Fehleranalyse: Poste den Inhalt Deiner liblist.gam, (listen)server.cfg, adminmod.cfg, users.ini, vault.ini, plugin.ini von adminmod und plugins.ini von metamod. Benutze auch die
Such-Funktion