AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Train autokicker (https://forums.alliedmods.net/showthread.php?t=13566)

Herr_Rossi 05-21-2005 10:31

Train autokicker
 
Hi @all!
Sorry, mine englich is not good, therefore I do not write an assistance in German there I in the German forum leaders erhilt!

My problem:
Ich möchte in das train autokicker Plugin den Befehl zu einem Mapwechsel, 5 min vor der ersten Hutausgabe (show_hudmessage(0,"!!! ACHTUNG ACHTUNG ACHTUNG !!!^nIn 10 min beginnt Clan-Training!") einfügen! Hier mal der komplette Code des Plugins der funktionirt nur leider fehlt mir da der Mapwechsel!

Code:

#include <amxmod>

new ctdate[7] = {5,6}
new cttime[2] = {20,00}

new sotw1 = 1
new sotw2 = 1
new sotw3 = 1
new sotw4 = 1
new sotw5 = 1

public kick_player()
{
        new players[32], inum
        get_players(players,inum,"","")
        for(new i = 0 ;i < inum ;++i){
                if (!(get_user_flags(players[i])&ADMIN_IMMUNITY)){
                                client_cmd(players[i],"echo ^"[AMX] Sorry, unser Clan hat nun Training! Versuche es Bitte spaeter wieder!^";disconnect")
                }
        }
        return PLUGIN_CONTINUE
}

public check_ausgabe()
{
        new todayd_str[8]
        get_time("%w",todayd_str,14)
        new todayd = strtonum(todayd_str)

        if ((todayd == ctdate[0])||(todayd == ctdate[1])||(todayd == ctdate[2])||(todayd == ctdate[3])||(todayd == ctdate[4])||(todayd == ctdate[5])||(todayd == ctdate[6]))
        {
                new today_str[8]
                get_time("%H",today_str,8)
                new todayh = strtonum(today_str)

                new today_strm[8]
                get_time("%M",today_strm,8)
                new todaym = strtonum(today_strm)
                new cttimea, cttimeb, cttimec, cttimed, cttimee, cttimef, cttimeg, cttimeh
                cttimea = cttime[0]
                cttimeb = cttime[1] - 10
                cttimec = cttime[0]
                cttimed = cttime[1] - 3
                cttimee = cttime[0]
                cttimef = cttime[1] - 2
                cttimeg = cttime[0]
                cttimeh = cttime[1] - 1

                switch(cttime[1]){
                        case 9: {
                                cttimea = cttime[0] - 1
                                cttimeb = 59
                                cttimed = 6
                                cttimef = 7
                                cttimeh = 8
                        }
                        case 8: {
                                cttimea = cttime[0] - 1
                                cttimeb = 58
                                cttimed = 5
                                cttimef = 6
                                cttimeh = 7
                        }
                        case 7: {
                                cttimea = cttime[0] - 1
                                cttimeb = 57
                                cttimed = 4
                                cttimef = 5
                                cttimeh = 6
                        }
                        case 6: {
                                cttimea = cttime[0] - 1
                                cttimeb = 56
                                cttimed = 3
                                cttimef = 4
                                cttimeh = 5
                        }
                        case 5: {
                                cttimea = cttime[0] - 1
                                cttimeb = 55
                                cttimed = 2
                                cttimef = 3
                                cttimeh = 4
                        }
                        case 4: {
                                cttimea = cttime[0] - 1
                                cttimeb = 54
                                cttimed = 1
                                cttimef = 2
                                cttimeh = 3
                        }
                        case 3: {
                                cttimea = cttime[0] - 1
                                cttimeb = 53
                                cttimed = 0
                                cttimef = 1
                                cttimeh = 2
                        }
                        case 2: {
                                cttimea = cttime[0] - 1
                                cttimeb = 52
                                cttimec = cttime[0] - 1
                                cttimed = 59
                                cttimef = 0
                                cttimeh = 1
                        }
                        case 1: {
                                cttimea = cttime[0] - 1
                                cttimeb = 51
                                cttimec = cttime[0] - 1
                                cttimed = 58
                                cttimee = cttime[0] - 1
                                cttimef = 59
                                cttimeh = 0
                        }
                        case 0: {
                                cttimea = cttime[0] - 1
                                cttimeb = 50
                                cttimec = cttime[0] - 1
                                cttimed = 57
                                cttimee = cttime[0] - 1
                                cttimef = 58
                                cttimeg = cttime[0] - 1
                                cttimeh = 59
                        }
                }
                if ((todayh == cttimea) && (todaym == cttimeb) && (sotw1== 1))
                {
                        sotw5 = 1
                        sotw1 = 0
                        set_hudmessage(0,255,0, -1.0, 0.30, 0, 6.0, 5.0, 1.0, 2.0, 2)
                        show_hudmessage(0,"!!! ACHTUNG ACHTUNG ACHTUNG !!!^nIn 10 min beginnt Clan-Training!")
                        client_print(0,print_chat,"*** [TAK] ACHTUNG!!! 10 Minuten bis zum Clan-Training! ***")
                        client_print(0,print_chat,"*** [TAK] ACHTUNG!!! 10 Minuten bis zum Clan-Training! ***")
                        client_print(0,print_chat,"*** [TAK] ACHTUNG!!! 10 Minuten bis zum Clan-Training! ***")
                }
                if ((todayh == cttimec) && (todaym == cttimed) && (sotw2 == 1))
                {
                        sotw1 = 1
                        sotw2 = 0
                        set_hudmessage(0,255,0, -1.0, 0.08, 0, 4.0, 8.0, 1.0, 1.0, 2)
                        show_hudmessage(0,"!!!ACHTUNG ACHTUNG ACHTUNG!!!^n3 Minuten bis zum Clan-Training!")
                        client_print(0,print_chat,"*** [TAK] ACHTUNG!!! 3 Minuten bis zum Clan-training! ***")
                        client_print(0,print_chat,"*** [TAK] An alle nicht Clan-Member: Bitte verlasst langsam den Server! DANKE! ***")
                }
                if ((todayh == cttimee) && (todaym == cttimef) && (sotw3 == 1))
                {
                        sotw2 = 1
                        sotw3 = 0
                        set_hudmessage(0,255,0, -1.0, 0.08, 0, 4.0, 8.0, 1.0, 1.0, 2)
                        show_hudmessage(0,"!!!ACHTUNG ACHTUNG ACHTUNG!!!^n2 Minuten bis zum Clan-Training!^n^n1 Minute bis AutoKicker startet!")
                        client_print(0,print_chat,"*** [TAK] !!!ACHTUNG!!! 2 Minuten bis zum Clan-Training! ***")
                        client_print(0,print_chat,"*** [TAK] An alle nicht Clan-Member: Bitte verlasst den Server JETZT! DANKE! ***")
                        client_print(0,print_chat,"*** [TAK] AutoKick startet in einer Minute! ***")
                }
                if ((todayh == cttimeg) && (todaym == cttimeh) && (sotw4 == 1))
                {
                        sotw3 = 1
                        sotw4 = 0
                        set_hudmessage(0,255,0, -1.0, 0.30, 0, 6.0, 5.0, 1.0, 2.0, 2)
                        show_hudmessage(0,"ACHTUNG! 1 Minuten bis zum Clan-Training!^nAutoKicker startet jetzt!")
                        client_print(0,print_chat,"*** [TAK] ACHTUNG! 1 Minute bis zum Clan-Training! ***")
                        client_print(0,print_chat,"*** [TAK] AutoKick startet jetzt! ***")
                        set_cvar_string("sv_password","tdtrain");
                        kick_player()
                }
                if ((todayh == cttime[0]) && (todaym == cttime[1]) && (sotw5 == 1))
                {
                        sotw4 = 1
                        sotw5 = 0
                        set_hudmessage(0,255,0, -1.0, 0.30, 0, 6.0, 5.0, 1.0, 2.0, 2)
                        show_hudmessage(0,"Server-Password wurde gesetzt^nTrainings Config wird geladen^n^n*** Viel Spass beim Training ***")
                        client_print(0,print_chat,"*** [TAK] Alle nicht autorisierten Spieler haben den Server verlassen! ***")
                        server_cmd("exec ^"addons/amxmodx/configs/amxmd/leagues/train.cfg^"")
                        server_cmd("exec ^"addons/amxmodx/configs/amxmd/leagues/default.cfg^"")
                }
        }
        return PLUGIN_CONTINUE
}

public plugin_init()
{
        register_plugin("TrainAutoKicker","0.3","ST4life"")
        set_task(10.0, "check_ausgabe",0,"",0,"b")
        return PLUGIN_CONTINUE
}

plz help me thx :cry:

n0obie4life 05-21-2005 10:49

use the small tags.


All times are GMT -4. The time now is 16:36.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.