Beiträge von Keine_Person

    Ich möchte aus einem Enum herauslesen wie hoch das Maximal ist. Habs mir so gedacht aber das geht nicht:

    #define MAX_INVENTAR Inventar_Name
    enum Inventar_Name
    {
    PolosChickenwings[128],
    FreddysMargarithaPizaa[128],
    Sprunk[128],
    Cannabis[128],
    CrystalMeth[128],
    Heroin[128],
    Kokain[128]
    }



    Finde die Funktion zum auszählen nicht falls es nicht leichter geht. Jemand schnelle Hilfe parat?

    Ah da war der Fehler, ich danke dir!
    Irgendwas failt da noch
    case DIALOG_LOGIN_1: { if(!response)return CON_CLOSE; new key[128]; //new file[128]; format(file,sizeof(file),"/Accounts/%s.inc",GetName(playerid)); format(key,sizeof(key), dini_Get(file, "key")); if(key[0] != EOS && inputtext[0] != EOS && !strcmp(inputtext, key)) { /*new string[128]; format(Info[playerid][CharacterName1],sizeof(string),dini_Get(file, "CharacterName1")); format(Info[playerid][CharacterName2],MAX_PLAYER_NAME,dini_Get(file, "CharacterName2")); format(Info[playerid][CharacterName3],MAX_PLAYER_NAME,dini_Get(file, "CharacterName3")); format(string,sizeof(string),"%s\n%s\n%s",Info[playerid][CharacterName1],Info[playerid][CharacterName2],Info[playerid][CharacterName3]); print(string); print(Info[playerid][CharacterName1]); print(Info[playerid][CharacterName2]); print(Info[playerid][CharacterName3]); ShowPlayerDialog(playerid,DIALOG_LOGIN_2,DIALOG_STYLE_LIST,"Charaktere:",string,"Login","Abbrechen");*/ new ch[3][MAX_PLAYER_NAME],string[128]; format(Info[playerid][CharacterName1],MAX_PLAYER_NAME,dini_Get(file, "CharacterName1")); format(Info[playerid][CharacterName2],MAX_PLAYER_NAME,dini_Get(file, "CharacterName2")); format(Info[playerid][CharacterName3],MAX_PLAYER_NAME,dini_Get(file, "CharacterName3")); if(Info[playerid][CharacterName1][0] == EOS) ch[0] = "/"; else strcat(ch[0],Info[playerid][CharacterName1]); if(Info[playerid][CharacterName2][0] == EOS) ch[1] = "/"; else strcat(ch[1],Info[playerid][CharacterName2]); if(Info[playerid][CharacterName3][0] == EOS) ch[2] = "/"; else strcat(ch[2],Info[playerid][CharacterName3]); format(string,sizeof(string),"%s\n%s\n%s",ch[0],ch[1],ch[2]); ShowPlayerDialog(playerid,DIALOG_LOGIN_2,DIALOG_STYLE_LIST,"Charaktere:",string,"Login","Abbrechen"); print(string); print(Info[playerid][CharacterName1]); print(Info[playerid][CharacterName2]); print(Info[playerid][CharacterName3]); return 1; } }


    Code
    Character free0=1
    Character free1=0
    Character free2=0
    CharacterName1=Arnold
    CharacterName2=Leer
    CharacterName3=Leer
    key=weeder77
    Password Given=1


    C:\Program Files\Grand Theft Auto San Andreas\gamemodes\ganmore.pwn(535) : warning 219: local variable "ch" shadows a variable at a preceding level

    Da war das doch nur das Problem das der String leer war. Daher hab ich mir gedacht ich schreib einfach was rein. Hab ich doch so oben erklärt, sorry wenn es nicht zu erkennen war. Ich werde mal dein Code nutzen.



    new ch[3][MAX_PLAYER_NAME],string[128];
    format(Info[playerid][CharacterName1],MAX_PLAYER_NAME,dini_Get(file, "CharacterName1"));
    format(Info[playerid][CharacterName2],MAX_PLAYER_NAME,dini_Get(file, "CharacterName2"));
    format(Info[playerid][CharacterName3],MAX_PLAYER_NAME,dini_Get(file, "CharacterName3"));
    if(Info[playerid][CharacterName1][0] == EOS) ch[0] = "/";
    else strcat(ch[0],Info[playerid][CharacterName1]);
    if(Info[playerid][CharacterName2][0] == EOS) ch[1] = "/";
    else strcat(ch[1],Info[playerid][CharacterName2]);
    if(Info[playerid][CharacterName3][0] == EOS) ch[2] = "/";
    else strcat(ch[2],Info[playerid][CharacterName3]);
    format(string,sizeof(string),"%s\n%s\n%s",ch[0],ch[1],ch[2]);
    ShowPlayerDialog(playerid,DIALOG_LOGIN_2,DIALOG_STYLE_LIST,"Charaktere:",string,"Login","Abbrechen");
    print(string);
    print(Info[playerid][CharacterName1]);
    print(Info[playerid][CharacterName2]);
    print(Info[playerid][CharacterName3]);


    Print:
    /
    /
    /
    <null>
    <null>
    <null>


    if(!response)return CON_CLOSE;
    new key[128];
    new file[128];
    format(file,sizeof(file),"/Accounts/%s.inc",GetName(playerid));
    format(key,sizeof(key), dini_Get(file, "key"));
    if(key[0] != EOS && inputtext[0] != EOS && !strcmp(inputtext, key))
    {
    new string[128];
    format(Info[playerid][CharacterName1],sizeof(string),dini_Get(file, "CharacterName1"));
    format(Info[playerid][CharacterName2],MAX_PLAYER_NAME,dini_Get(file, "CharacterName2"));
    format(Info[playerid][CharacterName3],MAX_PLAYER_NAME,dini_Get(file, "CharacterName3"));
    format(string,sizeof(string),"%s\n%s\n%s",Info[playerid][CharacterName1],Info[playerid][CharacterName2],Info[playerid][CharacterName3]);
    print(string);
    print(Info[playerid][CharacterName1]);
    print(Info[playerid][CharacterName2]);
    print(Info[playerid][CharacterName3]);
    ShowPlayerDialog(playerid,DIALOG_LOGIN_2,DIALOG_STYLE_LIST,"Charaktere:",string,"Login","Abbrechen");
    return 1;
    }



    Der Pfad stimmt, andere Dinge werden ja auch geladen wie das Passwort.

    String ist einfach leer.

    Wird leider nichts im Dialog angezeigt. Hab ich da den Fehler oder muss ich woanders suchen?




    enum Account_Daten
    {
    bool:PasswortVergeben,
    bool:CharacterFrei[3],
    CharacterName1[MAX_PLAYER_NAME],
    CharacterName2[MAX_PLAYER_NAME],
    CharacterName3[MAX_PLAYER_NAME],
    RpPoints[MAX_PLAYERS],
    pMoney[MAX_PLAYERS]
    };



    format(Info[playerid][CharacterName1],MAX_PLAYER_NAME,dini_Get(file, "CharacterName1"));
    format(Info[playerid][CharacterName2],MAX_PLAYER_NAME,dini_Get(file, "CharacterName2"));
    format(Info[playerid][CharacterName3],MAX_PLAYER_NAME,dini_Get(file, "CharacterName3"));
    format(string,sizeof(string),"%s\n%s\n%s",Info[playerid][CharacterName1],Info[playerid][CharacterName2],Info[playerid][CharacterName3]);
    ShowPlayerDialog(playerid,DIALOG_LOGIN_2,DIALOG_STYLE_LIST,"Charaktere:",string,"Login","Abbrechen");

    Irgendwie werde ich immer vom Server gekickt (an dieser Stelle) obwohl ich im Ordner Accounts eine Inc Datei mit dem Namen erstellt habe den ich nutze.




    public OnPlayerConnect(playerid)
    {
    new file[128];
    GetPlayerName(playerid,p_name[playerid],MAX_PLAYER_NAME);
    SpawnStep[playerid] = 0;
    Spawn(playerid);
    format(file,sizeof(file),"/Accounts/%s.inc",GetName(playerid));
    if(dini_Exists(file))
    {
    //Abfrage ob Account ein Passwort hat
    Info[playerid][PasswortVergeben] = dini_Bool(file,"Password Given");
    if(Info[playerid][PasswortVergeben] == false)
    {
    ShowPlayerDialog(playerid,DIALOG_REGISTER_1,DIALOG_STYLE_INPUT,"Registration","Gib nun bitte dein Passwort ein.","Registrieren","Abbrechen");
    }
    else
    {
    ShowPlayerDialog(playerid,DIALOG_LOGIN_1,DIALOG_STYLE_INPUT,"Login","Gib nun bitte dein Passwort ein.","Einloggen","Abbrechen");
    }
    }
    else
    {
    new string[128];
    format(string,sizeof(string),"%s dont exist and left the server!",file);
    print(string);
    CON_CLOSE;
    }
    return 1;
    }








    #define CON_CLOSE SCM(playerid,rot,"Du hast den Vorgang abgebrochen"),Kick(playerid)

    Der Print kommt aber keine Nachricht auf dem Server...