Beiträge von JustMe.77

    Versuch's mal so:




    new bool:P_Eingeloggt[MAX_PLAYERS];




    public OnPlayerText(playerid, text[])
    {




    if(P_Eingeloggt[playerid] == false)
    {
    SendClientMessage(playerid, dunkelrot,"Du musst erst spawnen bevor du etwas schreiben kannst!");
    return 0;
    }



    return 1;
    }




    public OnPlayerCommandText(playerid, cmdtext[])
    {



    if(P_Eingeloggt[playerid] == false)
    {
    SendClientMessage(playerid, dunkelrot, "Du musst eingeloggt sein um ein Befehl auszuführen");
    return 0;
    }
    return 1;
    }





    stock Login(playerid,key[]) //LOGIN STOCK
    {
    new Spieler[999];
    new SName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,SName,sizeof(SName));
    format(Spieler,sizeof(Spieler),"/Spieler/%s.txt",SName);
    if(!strcmp(key,dini_Get(Spieler,"Passwort"),true))
    {
    TogglePlayerSpectating(playerid, false);
    TextDrawHideForPlayer(playerid, schwarzebalken1);
    TextDrawHideForPlayer(playerid, schwarzebalken2);
    P_Eingeloggt[playerid] = true;
    SetSpawnInfo(playerid, 0, 0, -2390.5242, 2216.9639, 4.9844, 87.6531 ,0 ,0 ,0 ,0 ,0 ,0 ); //
    SpawnPlayer(playerid);
    return 1;
    }
    else
    {
    SendClientMessage(playerid,dunkelrot,"Du hast ein falsches Passwort eingegeben.");
    SendClientMessage(playerid,dunkelrot,"Du wurdest vom Server gekickt!");
    Kick(playerid);
    }
    return 1;
    }




    stock Register(playerid,key[]) //REGISTER STOCK
    {
    new Spieler[999];
    new SName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,SName,sizeof(SName));
    format(Spieler,sizeof(Spieler),"/Spieler/%s.txt",SName);
    dini_Create(Spieler);
    dini_Set(Spieler,"Passwort",key);
    TogglePlayerSpectating(playerid, false);
    TextDrawHideForPlayer(playerid, schwarzebalken1);
    TextDrawHideForPlayer(playerid, schwarzebalken2);
    SetSpawnInfo(playerid, 0, 0, -2390.5242, 2216.9639, 4.9844, 87.6531 ,0 ,0 ,0 ,0 ,0 ,0 ); //
    P_Eingeloggt[playerid] = true;
    SpawnPlayer(playerid);
    return 1;
    }

    Musst du eventuell anpassen / untestet (sag mir bescheid wenn du Errors erhälst)



    new bool:P_Eingeloggt[MAX_PLAYERS];



    public OnPlayerText(playerid, text[])
    {



    if(P_Eingeloggt[playerid] == false)
    {
    SendClientMessage(playerid, dunkelrot,"Du musst erst spawnen bevor du etwas schreiben kannst!");
    return 0;
    }



    }



    public OnPlayerCommandReceived(playerid, cmdtext[])
    {



    if(P_Eingeloggt[playerid] == false)
    {
    SendClientMessage(playerid, dunkelrot, "Du musst eingeloggt sein um ein Befehl auszuführen");
    return 0;
    }
    return 1;
    }




    stock Login(playerid,key[]) //LOGIN STOCK
    {
    new Spieler[999];
    new SName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,SName,sizeof(SName));
    format(Spieler,sizeof(Spieler),"/Spieler/%s.txt",SName);
    if(!strcmp(key,dini_Get(Spieler,"Passwort"),true))
    {
    TogglePlayerSpectating(playerid, false);
    TextDrawHideForPlayer(playerid, schwarzebalken1);
    TextDrawHideForPlayer(playerid, schwarzebalken2);
    P_Eingeloggt[playerid] = true;
    SetSpawnInfo(playerid, 0, 0, -2390.5242, 2216.9639, 4.9844, 87.6531 ,0 ,0 ,0 ,0 ,0 ,0 ); //
    SpawnPlayer(playerid);
    return 1;
    }
    else
    {
    SendClientMessage(playerid,dunkelrot,"Du hast ein falsches Passwort eingegeben.");
    SendClientMessage(playerid,dunkelrot,"Du wurdest vom Server gekickt!");
    Kick(playerid);
    }
    return 1;
    }



    stock Register(playerid,key[]) //REGISTER STOCK
    {
    new Spieler[999];
    new SName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,SName,sizeof(SName));
    format(Spieler,sizeof(Spieler),"/Spieler/%s.txt",SName);
    dini_Create(Spieler);
    dini_Set(Spieler,"Passwort",key);
    TogglePlayerSpectating(playerid, false);
    TextDrawHideForPlayer(playerid, schwarzebalken1);
    TextDrawHideForPlayer(playerid, schwarzebalken2);
    SetSpawnInfo(playerid, 0, 0, -2390.5242, 2216.9639, 4.9844, 87.6531 ,0 ,0 ,0 ,0 ,0 ,0 ); //
    P_Eingeloggt[playerid] = true;
    SpawnPlayer(playerid);
    return 1;
    }

    Îch hab's so geregelt:



    #define Kick(%0) SetTimerEx("DelayKick", 250, false, "i", %0)
    #define Ban(%0) SetTimerEx("DelayBan", 250, false, "i", %0)




    forward DelayBan(p);
    forward DelayKick(p);



    public DelayKick(p)
    {
    #undef Kick
    Kick(p);
    #define Kick(%0) SetTimerEx("DelayKick", 250, false, "i", %0)
    return 1;
    }



    public DelayBan(p) {
    #undef Ban
    Ban(p);
    #define Ban(%0) SetTimerEx("DelayBan", 250, false, "i", %0)
    return 1;
    }


    Dann einfach ganz normal Kick oder Ban verwenden :)