So hab mal in den tiefen meiner Festplatte gekramt,
da hab ich das timermem2 plugin gefunden und es verändert.
Da ich ein absoluter Scriptingnuub bin schaut mal ob es gehen könnte:
#include <core>
#include <console>
#include <string>
#include <admin>
#include <adminlib>
#define ACCESS_CONSOLE 131072
new STRING_VERSION[MAX_DATA_LENGTH] = "Beta 1.0";
#define MinutesRed 255
#define MinutesGreen 0
#define MinutesBlue 0
#define SecondsRed 255
#define SecondsGreen 255
#define SecondsBlue 255
new GameCommencing=0;
new checktime;
new origtimelimit;
new timer;
new Map[MAX_NAME_LENGTH];
/*--- Für mapvoting des plugins vote_for_it ---*/
new votetimer;
new voteallowed;
public timerem2_welt(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;
checktime =systemtime();
origtimelimit = getvar("mp_timelimit")*60+2;
kill_timer(timer);
timer=set_timer("warn",1, 0);
}
else if(strcmp(x,"Restart")==0){
origtimelimit =getvar("mp_timelimit")*60+2;
checktime = systemtime();
kill_timer(timer);
timer=set_timer("warn",1,0);
}
else if(strcmp(x,"Round")==0){
if (getvar("mp_timelimit")*60+2 != origtimelimit){
checktime = systemtime()-(systemtime()- checktime);
origtimelimit= getvar("mp_timelimit")*60+2;
kill_timer(timer);
timer=set_timer("warn",1,0);
}
voteallowed=0;
set_timer("check_vote",20,0);
}
return PLUGIN_CONTINUE;
}
public warn(Timer,Repeat,HLUser,HLParam)
{
new a;
new time;
new Msg[MAX_TEXT_LENGTH];
if (getvar("mp_timelimit")*60+2 != origtimelimit){
checktime = systemtime()-(systemtime()- checktime);
origtimelimit= getvar("mp_timelimit")*60+2;
}
time = (origtimelimit-(systemtime()-checktime));
switch(time){
case 1800:{
execclient_all("speak ^"fvox/thirty minutes remaining^"");
centersay("30 Minuten bis zum Mapchange!",12,MinutesRed,MinutesGreen,MinutesBlue);
a = 300;
}
case 1500:{
execclient_all("speak ^"fvox/twenty five minutes remaining^"");
centersay("25 Minuten bis zum Mapchange!",12,MinutesRed,MinutesGreen,MinutesBlue);
a = 300;
}
case 1200:{
execclient_all("speak ^"fvox/twenty minutes remaining^"");
centersay("20 Minuten bis zum Mapchange!",12,MinutesRed,MinutesGreen,MinutesBlue);
a = 300;
}
case 900:{
execclient_all("speak ^"fvox/fifteen minutes remaining^"");
centersay("15 Minuten bis zum Mapchange!",12,MinutesRed,MinutesGreen,MinutesBlue);
a = 300;
}
case 600:{
execclient_all("speak ^"fvox/ten minutes remaining^"");
centersay("10 Minuten bis zum Mapchange!",12,MinutesRed,MinutesGreen,MinutesBlue);
a = 300;
}
case 300:{
execclient_all("speak ^"fvox/five minutes remaining^"");
centersay("5 Minuten bis zum Mapchange!",12,MinutesRed,MinutesGreen,MinutesBlue);
a = 180;
}
case 120:{
execclient_all("speak ^"fvox/two minutes remaining^"");
centersay("2 Minuten bis zum Mapchange!",12,MinutesRed,MinutesGreen,MinutesBlue);
a = 60;
}
case 60:{
execclient_all("speak ^"fvox/sixty seconds remaining^"");
centersay("60 Sekunden bis zum Mapchange!",12,SecondsRed,SecondsGreen,SecondsBlue);
votetimer=set_timer("do_vote",1,99999);
a = 30;
}
case 30:{
execclient_all("speak ^"fvox/thirty seconds remaining^"");
centersay("30 Sekunden bis zum Mapchange!",12,SecondsRed,SecondsGreen,SecondsBlue);
a = 20;
}
case 10:{
execclient_all("speak ^"fvox/ten^"");
centersay("TEN!",12,SecondsRed,SecondsGreen,SecondsBlue);
a = 1;
}
case 9:{
execclient_all("speak ^"fvox/nine^"");
centersay("NINE!",12,SecondsRed,SecondsGreen,SecondsBlue);
a = 1;
}
case 8:{
execclient_all("speak ^"fvox/eight^"");
centersay("EIGHT!",12,SecondsRed,SecondsGreen,SecondsBlue);
a = 1;
}
case 7:{
execclient_all("speak ^"fvox/seven^"");
centersay("SEVEN!",12,SecondsRed,SecondsGreen,SecondsBlue);
a = 1;
}
case 6:{
execclient_all("speak ^"fvox/six^"");
centersay("SIX!",12,SecondsRed,SecondsGreen,SecondsBlue);
a = 1;
nextmap( Map, MAX_NAME_LENGTH );
}
case 5:{
execclient_all("speak ^"fvox/five^"");
snprintf(Msg,MAX_TEXT_LENGTH,"FIVE! ^nNext Map:%s",Map);
centersay(Msg,12,SecondsRed,SecondsGreen,SecondsBlue);
a = 1;
}
case 4:{
execclient_all("speak ^"fvox/four^"");
snprintf(Msg,MAX_TEXT_LENGTH,"FOUR! ^nNext Map:%s",Map);
centersay(Msg,12,SecondsRed,SecondsGreen,SecondsBlue);
a = 1;
}
case 3:{
execclient_all("speak ^"fvox/three^"");
snprintf(Msg,MAX_TEXT_LENGTH,"THREE! ^nNext Map:%s",Map);
centersay(Msg,12,SecondsRed,SecondsGreen,SecondsBlue);
a = 1;
}
case 2:{
execclient_all("speak ^"fvox/two^"");
snprintf(Msg,MAX_TEXT_LENGTH,"TWO! ^nNext Map:%s",Map);
centersay(Msg,12,SecondsRed,SecondsGreen,SecondsBlue);
a = 1;
}
case 1:{
execclient_all("speak ^"fvox/one^"");
snprintf(Msg,MAX_TEXT_LENGTH,"ONE! ^nNext Map:%s",Map);
centersay(Msg,12,SecondsRed,SecondsGreen,SecondsBlue);
a = 1;
}
case 0:{
execclient_all("speak ^"have a nice day^"");
snprintf(Msg,MAX_TEXT_LENGTH,"Game Over!^nChanging Map to:%s",Map);
centersay(Msg,12,SecondsRed,SecondsGreen,SecondsBlue);
say(Msg);
}
default:{
if(time>1800){
a = time-1800;
}else if(time<1800 && time>1500){
a = time - 1500;
}else if(time<1500 && time>1200){
a = time - 1200;
}else if(time<1200 && time>900){
a = time - 900;
}else if(time<900 && time>600){
a = time - 600;
}else if(time<600 && time>300){
a = time - 300;
}else if(time<300 && time>120){
a = time - 120;
}else if(time<120 && time>60){
a = time - 60;
}else if(time<60 && time>30){
a = time - 30;
}else{
a=1;
}
}
}
execclient_all("timeleft");/*Debug-Funktion, um zu sehen, ob das Announcing stimmt*/
/*
new Msg[MAX_TEXT_LENGTH];
snprintf(Msg,MAX_TEXT_LENGTH,"Naechste Timer in %i Sekunden",a);
say(Msg);
*/
timer=set_timer("warn",a, 0);
return PLUGIN_CONTINUE;
}
public check_vote(Timer,Repeat,HLUser,HLParam)
{
voteallowed=1;
return PLUGIN_CONTINUE;
}
public do_vote(Timer,Repeat,HLUser,HLParam)
{
if (voteallowed==1){
kill_timer(votetimer);
if(getvar("admin_vote_autostart")==1){
plugin_exec("admin_vote_multimap","");
}
}
return PLUGIN_CONTINUE;
}
public plugin_init(){
plugin_registerinfo("Ein Timeremember auf LogD-Basis","",STRING_VERSION);
plugin_registercmd("timerem2_welt", "timerem2_welt", ACCESS_CONSOLE);
exec("logd_reg 62 admin_command timerem2_welt");
checktime =systemtime();
origtimelimit = getvar("mp_timelimit")*60+2;
timer=set_timer("warn",1, 0);
return PLUGIN_CONTINUE;
}
Greets
metaxa
P.s. Dieses Script basiert natürlich auf Sir Drink a Lots geändertem Timerem2
|