AdminMod.de
https://www.adminmod.de/

Mapchange erst wenn Runde fertig ist
https://www.adminmod.de/viewtopic.php?t=2028
Seite 1 von 1

Autor:  @vus [ 21.03.2002, 20:05 ]
Betreff des Beitrags:  Mapchange erst wenn Runde fertig ist

Hi Jungzz 8)

ich habe versucht mir ein plugin zu schreiben, dass erst nach dem die Runde vorbei ist die nächste Map ladet.

1.) gibt es sowas schon?
2.) Wie kann ich abfragen ob die Runde beendet ist?
3.) Ich habe mal begonnen aber das mit
exec( "logd_reg 62 admin_command ks_resetscore" );
will nicht ganz so :-?

Könnt ihr mir bitte erklären was es mit diesem Code auf sich hat?
das er ein Commando von ClanMod bei Adminmod registert is mir klar aber die nummern ????

Ich habe es so wie in Killstreak gemacht nur funzt da nichts (auch keine Fehler).
Kann mir wer helfen?

Autor:  @vus [ 21.03.2002, 20:12 ]
Betreff des Beitrags:  Code...

Code:
#include <core>
#include <console>
#include <string>
#include <admin>
#include <adminlib>

#define ACCESS_CONSOLE 131072

new STRING_VERSION[MAX_DATA_LENGTH] = "1.0.0.0";
new GameOver = 0;

public warn00() {
    /*exec("mp_timelimit 0.1");*/
    GameOver = 1;
}

public warn60() {
    centersay("6 0   s e c o n d s   r e m a i n i n g !",5,255,0,0);
    return PLUGIN_CONTINUE;
}

public warn5() {
    centersay("5   m i n u t e s   r e m a i n i n g .",5,0,0,255);
    return PLUGIN_CONTINUE;
}

public warn10() {
    centersay("1 0   m i n u t e s   r e m a i n i n g .",5,0,0,255);
    return PLUGIN_CONTINUE;
}

public warn20() {
    centersay("2 0   m i n u t e s   r e m a i n i n g .",5,0,0,255);
    return PLUGIN_CONTINUE;
}

public warn05() {
    centersay("5   s e c o n d s   r e m a i n i n g !",1,255,0,0);

    new Text[MAX_TEXT_LENGTH] = "";
    strcat(Text,"5  s e c o n d s  r e m a i n i n g !",MAX_DATA_LENGTH);
    typesay(Text, 7, 255, 0, 0);

    return PLUGIN_CONTINUE;
}

public warn04() {
    centersay("4   s e c o n d s   r e m a i n i n g !",1,255,0,0);

    new Text[MAX_TEXT_LENGTH] = "";
    strcat(Text,"4  s e c o n d s  r e m a i n i n g !",MAX_DATA_LENGTH);
    typesay(Text, 7, 255, 0, 0);

    return PLUGIN_CONTINUE;
}

public warn03() {
    centersay("3   s e c o n d s   r e m a i n i n g !",1,255,0,0);

    new Text[MAX_TEXT_LENGTH] = "";
    strcat(Text,"3  s e c o n d s  r e m a i n i n g !",MAX_DATA_LENGTH);
    typesay(Text, 7, 255, 0, 0);

    return PLUGIN_CONTINUE;
}

public warn02() {
    centersay("2   s e c o n d s   r e m a i n i n g !",1,255,0,0);

    new Text[MAX_TEXT_LENGTH] = "";
    strcat(Text,"2  s e c o n d s  r e m a i n i n g !",MAX_DATA_LENGTH);
    typesay(Text, 7, 255, 0, 0);

    return PLUGIN_CONTINUE;
}

public warn01() {
    centersay("1   s e c o n d   r e m a i n i n g !",1,255,0,0);

    new Text[MAX_TEXT_LENGTH] = "";
    strcat(Text,"1  s e c o n d  r e m a i n i n g !",MAX_DATA_LENGTH);
    typesay(Text, 7, 255, 0, 0);

    return PLUGIN_CONTINUE;
}

public ks_newround(HLCommand,HLData,HLUserName,UserIndex,Param)
{
	new Data[MAX_NAME_LENGTH];
	convert_string(HLData,Data,MAX_NAME_LENGTH);
	
	if(	strcmp(	"Round_Start", Data	) != 0 )
		return PLUGIN_HANDLED;

	if(     GameOver == !0){
		exec("mp_timelimit 0.1");
		GameOver = 0;
	}


	return PLUGIN_HANDLED;
}

public plugin_init() {
    plugin_registerinfo("Time Remaining Announcer","Announces time remaining automatically",STRING_VERSION);
    plugin_registercmd("ks_newround", "ks_newround", ACCESS_CONSOLE, "");

    exec("mp_timelimit 40");
    
    set_timer("warn20",  600, 2);
    set_timer("warn10", 1200, 2);
    set_timer("warn5" , 1500, 2);
    set_timer("warn60", 1740, 2);
    set_timer("warn05", 1795, 2);
    set_timer("warn04", 1796, 2);
    set_timer("warn03", 1797, 2);
    set_timer("warn02", 1798, 2);
    set_timer("warn01", 1799, 2);
    set_timer("warn00", 1800, 2);

    exec( "logd_reg 62 admin_command ks_newround" );

    return PLUGIN_CONTINUE;
}

Autor:  Sir Drink a lot [ 21.03.2002, 20:33 ]
Betreff des Beitrags: 

Hast Du mal mein aktuelles logd_timerem probiert ?
Ist ein wenig genauer. Und wenn Du in den letzten If-Satz(time==0) noch ein changelevel(NextMap,4) reinschreibst, dann kommt auch immer die Nextmap die angezeigt wird.

Autor:  @vus [ 29.03.2002, 12:39 ]
Betreff des Beitrags:  hmm...

Ich hab jetzt mal alle exec("mp_timelimit 0.1") durch
changelevel(Nextmap,4) ersetzt, jetzt kennt er NextMap nicht :cry:

So was jetzt? Kannst du mir vielleicht mal sagen, wie man abfragen kann ob die Runde vorbei ist?? Ich blick da nämlich nicht so durch :o
THX im voraus

Autor:  @vus [ 29.03.2002, 13:42 ]
Betreff des Beitrags:  Juhu...

Ich habs geschafft :)
Tja war ja auch nichtmehr schwer...

Auf jedenfall changed er erst die Map wenn die Runde fertig gespielt wurde
Das einzige, dass nicht funzt ist das speak .....
Woran liegt es? kann es sein dass ich die Deutsche Version von HL hab?
Ich hab jedoch die Englische Version von CS! :-?

Autor:  [COLA]*Whiskey [ 29.03.2002, 23:44 ]
Betreff des Beitrags: 

ich möchte (immernoch) n befehl mit dem man die nextmap per admin befehl eingeben kann ich habs nu bestimmt schon seit über ner woche versucht aber das funzt einfach nich ich hab hier ma den aktuellen code. falls einer den fehler findet sach bescheid
Code:
#include <core> 
#include <console> 
#include <string> 
#include <admin> 
#include <adminlib> 
#define ACCESS_CONSOLE 131072 

new STRING_VERSION[MAX_DATA_LENGTH] = "1.2"; 
new checktime = 0; 
new time = 0; 
new GameCommencing = 0; 
new origtimelimit = 0;
new nextmap2[MAX_NAME_LENGTH];

public execute_all(a[]) 
{ 
    new userid = 0; 
    new wonid = 0; 
    new teamid = 0; 
    new username[200]; 
    new i = 0; 
    new x = 0; 
    x = maxplayercount(); 
    for (i = 1; i <= x; i = i + 1) 
    { 
        strinit(username); 
        if (playerinfo(i, username, 200, userid, wonid, teamid) == 1) 
        { 
            execclient(username, a); 
        } 
    } 
} 

public admin_nmap(HLCommand,HLData,HLUserName,UserIndex) { 
new Command[MAX_COMMAND_LENGTH]; 
new Data[MAX_DATA_LENGTH]; 
new User[MAX_NAME_LENGTH];

convert_string(HLCommand,Command,MAX_COMMAND_LENGTH); 
convert_string(HLData,Data,MAX_DATA_LENGTH); 
convert_string(HLUserName,User,MAX_NAME_LENGTH); 

if (valid_map(Data)==1) { 
say_command(User,Command,Data); 
nextmap2 == (Data,MAX_DATA_LENGTH);
} else { 
selfmessage("Bad map name"); 
selfmessage(Data); 
} 
return PLUGIN_HANDLED; 
}

public welt(HLCommand,HLData,HLUserName,UserIndex) 
{ 
   new Data [MAX_DATA_LENGTH]; 
   new x [MAX_DATA_LENGTH];

   convert_string( HLData, Data, MAX_DATA_LENGTH ); 
   strsplit(Data,"# ",x,MAX_DATA_LENGTH); 
    
   if(strcmp(Data,"Game_Commencing")==0 && GameCommencing == 0) 
   { 
      GameCommencing = 1; 
      origtimelimit =getvar("mp_timelimit")*60+2; 
      checktime = systemtime(); 
      set_timer("timecheck",1,99999); 
   } 
   else if(strcmp(x,"Restart_Round_")==0) 
   { 
      origtimelimit =getvar("mp_timelimit")*60+2; 
      checktime = systemtime(); 
   } 
   return PLUGIN_HANDLED; 
} 

public timecheck(Timer,Repeat,HLUser,HLParam) 
{    
	new checkthetime; 
	new Text[MAX_TEXT_LENGTH]; 
	new Text2[MAX_TEXT_LENGTH];
	nextmap(nextmap2,MAX_NAME_LENGTH);

        if (getvar("mp_timelimit") == 0) 
        { 
		return PLUGIN_HANDLED;
        }
        if (getvar("mp_timelimit")*60+2 != origtimelimit) 
        { 
		checktime = systemtime()-(systemtime()- checktime); 
		origtimelimit= getvar("mp_timelimit")*60+2; 
        } 

        checkthetime = (origtimelimit-(systemtime()-checktime)); 
    
   	time = checkthetime; 
	
	if (time - 3600 == 0) 
	{ 
           	execute_all("speak ^"fvox/sixty minutes remaining^""); 
           	centersay("60 Minuten bis zum Mapchange !",6,255,255,255); 
	} 
	if (time - 1800 == 0) 
	{ 
           	execute_all("speak ^"fvox/thirty minutes remaining^""); 
           	centersay("30 Minuten bis zum Mapchange !",6,255,255,255); 
	} 
	if (time - 1500 == 0) 
	{ 
           	execute_all("speak ^"fvox/twenty five minutes remaining^""); 
           	centersay("25 Minuten bis zum Mapchange !",6,255,255,255); 
	} 
	if (time - 1200 == 0) 
	{ 
           	execute_all("speak ^"fvox/twenty minutes remaining^""); 
           	centersay("20 Minuten bis zum Mapchange !",6,255,255,255); 
	} 
	if (time - 900 == 0)
	{ 
           	execute_all("speak ^"fvox/fifteen minutes remaining^""); 
           	centersay("15 Minuten bis zum Mapchange !",6,255,255,255); 
	} 
	if (time - 600 == 0) 
	{ 
           	execute_all("speak ^"fvox/ten minutes remaining^""); 
           	centersay("10 Minuten bis zum Mapchange !",6,255,255,255); 
	} 
	if (time - 300 == 0) 
	{ 
                execute_all("speak ^"fvox/five minutes remaining^""); 
                centersay("5 Minuten bis zum Mapchange !",6,255,255,255); 
	} 
	if (time - 120 == 0) 
	{ 
           	execute_all("speak ^"fvox/two minutes remaining^""); 
           	centersay("2 Minuten bis zum Mapchange !",6,255,255,255); 
	} 
	if (time - 60 == 0) 
	{ 
                execute_all("speak ^"fvox/sixty seconds remaining^""); 
                centersay("60 Sekunden bis zum Mapchange !",6,255,0,0); 
	} 
	if (time - 30 == 0) 
	{ 
                execute_all("speak ^"fvox/thirty seconds remaining^""); 
                centersay("30 Sekunden bis zum Mapchange !",6,255,0,0); 
	} 
	if (time - 10 == 0) 
	{ 
                execute_all("speak ^"fvox/ten^""); 
                centersay("10 IIIIIIIIII",2,255,0,0); 
	} 
	if (time - 9 == 0) 
	{ 
                execute_all("speak ^"fvox/nine^""); 
                centersay("09 IIIIIIIII",2,255,0,0); 
	} 
	if (time - 8 == 0) 
	{ 
                execute_all("speak ^"fvox/eight^""); 
                centersay("08 IIIIIIII",2,255,0,0); 
	} 
	if (time - 7 == 0) 
	{ 
                execute_all("speak ^"fvox/seven^""); 
                centersay("07 IIIIIII",2,255,0,0); 
	} 
	if (time - 6 == 0) 
	{ 
                execute_all("speak ^"fvox/six^""); 
                centersay("06 IIIIII",2,255,0,0); 
	} 
	if (time - 5 == 0) 
	{ 
                execute_all("speak ^"fvox/five^""); 
                centersay("05 IIIII",2,255,0,0); 
	} 
	if (time - 4 == 0) 
	{ 
                execute_all("speak ^"fvox/four^""); 
                centersay("04 IIII",2,255,0,0); 
	} 
	if (time - 3 == 0) 
	{ 
                execute_all("speak ^"fvox/three^""); 
      		snprintf(Text, MAX_TEXT_LENGTH, "03 III^nDie naechste Map ist: %s",nextmap2); 
                centersay(Text,2,255,0,0); 
	} 
	if (time - 2 == 0) 
	{ 
                execute_all("speak ^"fvox/two^""); 
      		snprintf(Text, MAX_TEXT_LENGTH, "02 II^nDie naechste Map ist: %s",nextmap2); 
                centersay(Text,2,255,0,0); 
	} 
	if (time - 1 == 0) 
	{ 
                execute_all("speak ^"fvox/one^""); 
      		snprintf(Text, MAX_TEXT_LENGTH, "01 I^nDie naechste Map ist: %s",nextmap2); 
                centersay(Text,2,255,0,0); 
	} 
	if (time == 0) 
	{ 
                execute_all("speak ^"misc/gameover^""); 
                snprintf(Text, MAX_TEXT_LENGTH, "GAME OVER !^n Die naechste Map ist: %s",nextmap2); 
                centersay(Text,2,255,0,0); 
      		snprintf(Text2, MAX_TEXT_LENGTH, "Die naechste Map ist: %s",nextmap2); 
      		say(Text2);
		changelevel(nextmap2,5) 
	} 
        return PLUGIN_HANDLED; 
} 

public plugin_init() 
{ 
   plugin_registerinfo("Zeigt die verbleibende Zeit auf einer Map an","",STRING_VERSION); 
   plugin_registercmd("welt", "welt", ACCESS_CONSOLE); 
   plugin_registercmd("admin_nmap","admin_nmap",ACCESS_ALL,"admin_nmap: Edit the next map in cycle.");
       
   exec( "logd_reg 62 admin_command welt" ); 
   return PLUGIN_CONTINUE; 
}

Autor:  @vus [ 01.04.2002, 17:14 ]
Betreff des Beitrags:  toll

Bei mir geht des auch net mit
Code:
changelevel(NextMap)
--->plugin_logd_timerem.sma(49) Error [17]: undefined symbol "NextMap"

:cry:

Autor:  [COLA]*Whiskey [ 01.04.2002, 17:57 ]
Betreff des Beitrags: 

kuck dir das plugin mal etwas genauer an, da sind n paar mehr nextmap/nextmap2 befehle drin

Autor:  @vus [ 01.04.2002, 21:38 ]
Betreff des Beitrags:  jaja

Jaja hab ich gesehen :)
Nur ich weis net wie ich des Ding herleite bzw Definieren soll ...
Irgendwas mach ich da falsch aber was?

Seite 1 von 1 Alle Zeiten sind UTC+01:00
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/