Beiträge von MaRcEl9

    soweit war ich auch schon geht nicht wenn mach zB /bankregister passwort macht kommt nur es ist ein fehler beim login aufgetretten..


    #include <a_samp>
    #include <dini>
    #include <dutils>
    #include <dudb>
    #define COLOR_GREEN 0xFFFFFFAA
    #define COLOR_RED 0xFFFFFFAA
    new logged[MAX_PLAYERS];
    new idx;



    public OnPlayerDisconnect(playerid)
    {
    if (logged[playerid] == 1) dUserSetINT(PlayerName(playerid)).("geld", GetPlayerMoney(playerid));
    logged[playerid] = 0;
    return 1;
    }



    public OnPlayerCommandText(playerid, cmdtext[])
    {


    if (strcmp(cmd, "/login", true) == 0)
    {
    if (logged[playerid] != 1 && udb_Exists(PlayerName(playerid)))
    {
    new dir[256];
    dir = strtok(cmdtext, idx);
    if (strlen(dir) && strcmp(dir, dUser(PlayerName(playerid)).("password"), true) == 0)
    {
    logged[playerid] = 1;
    SendClientMessage(playerid, COLOR_RED, "Erfolgreich eingeloggt! Dein Geld wurde geladen!");
    GivePlayerMoney(playerid, dUserINT(PlayerName(playerid)).("geld"));
    }
    }
    else SendClientMessage(playerid, COLOR_RED, "Es ist ein Fehler beim Einloggen aufgetreten!");
    return 1;
    }


    if (strcmp(cmd, "/register", true) == 0)
    {
    if (logged[playerid] != 1 && !udb_Exists(PlayerName(playerid)))
    {
    new dir[256];
    dir = strtok(cmdtext, idx);
    if (strlen(dir))
    {
    new fname[MAX_STRING];
    format(fname,sizeof(fname),"%s.dudb.sav",udb_encode(PlayerName(playerid)));
    dini_Create(fname);
    dUserSet(PlayerName(playerid)).("password", dir);
    SendClientMessage(playerid, COLOR_RED, "Erfolgreich registriert! Bitte logge dich nun mit /banklogin [Passwort] ein!");
    }
    }
    else SendClientMessage(playerid, COLOR_RED, "Es ist ein Fehler beim Registrieren aufgetreten!");
    return 1;
    }
    //----------------------
    return 0;
    }
    stock PlayerName(playerid) {
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, MAX_PLAYER_NAME);
    return name;
    }




    C:\DOKUME~1\Marcel\Desktop\Sever\FILTER~1\KOPIEV~3.PWN(30) : error 017: undefined symbol "cmd"
    C:\DOKUME~1\Marcel\Desktop\Sever\FILTER~1\KOPIEV~3.PWN(48) : error 017: undefined symbol "cmd"
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    2 Errors.







    und wie kann ich so CMD definieren das es geht (ich hatte schon definiert aber ging nicht!)

    was ist falsch am bankregister warum gehen die commands nicht? (/bankregister PW geht nicht und /banklogin auch nicht...




    #include <a_samp>
    #include <dutils>
    #include <dudb>
    #define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
    #define COLOR_SYSTEM 0xEFEFF7AA
    #define MAX_TRIES 3
    #define COLOR_RED 0xFF0000FF
    #define COLOR_BLUE 0xFF0AAAFF


    new PLAYERLIST_authed[MAX_PLAYERS];
    new tries[MAX_PLAYERS];
    public OnFilterScriptInit()
    {
    print("\n==========================================");
    print(" Bank RegisterSystem ");
    print("\n==========================================");
    }
    stock SystemMsg(playerid,msg[]) {
    if ((IsPlayerConnected(playerid))&&(strlen(msg)>0)) {
    SendClientMessage(playerid,COLOR_SYSTEM,msg);
    }
    return 1;
    }
    stock PlayerName(playerid) {
    new name[255];
    GetPlayerName(playerid, name, 255);
    return name;
    }
    dcmd_bankregister(playerid,params[]) {
    if (PLAYERLIST_authed[playerid]) return SystemMsg(playerid,"deine bank ist schon eongeloggt.");
    if (udb_Exists(PlayerName(playerid))) return SystemMsg(playerid,"Bankaccount existiert schon '/banklogin password'.");
    if (strlen(params)==0) return SystemMsg(playerid,"Correct Usage: '/bankregister password'");
    if (udb_Create(PlayerName(playerid),params)) return SystemMsg(playerid,"Bankaccount erstellt um einzuloggen '/banklogin password' now.");
    return true;
    }

    dcmd_banklogin(playerid,params[]) {
    if (PLAYERLIST_authed[playerid]) return SystemMsg(playerid,"Deine bank ist schon eingeloggt.");
    if (!udb_Exists(PlayerName(playerid))) return SystemMsg(playerid,"Bankaccount existiert nicht '/bankregister password'.");
    if (strlen(params)==0) return SystemMsg(playerid,"Mache '/banklogin password'");
    if (udb_CheckLogin(PlayerName(playerid),params)) {
    // Status
    GivePlayerMoney(playerid,dUserINT(PlayerName(playerid)).("money")+GetPlayerMoney(playerid));

    PLAYERLIST_authed[playerid]=true;
    return SystemMsg(playerid,"bank erfolgreich eingeloggt!");
    }
    // Bad Password
    tries[playerid]++;
    if(tries[playerid] == MAX_TRIES) {
    SystemMsg(playerid,"Falsches bank passwort!!");


    }
    else if (tries[playerid] == MAX_TRIES-1){
    SendClientMessage(playerid, COLOR_RED, "Falsches passwort!!!");//ouch..
    }
    return 0;
    }

    public OnPlayerCommandText(playerid,cmdtext[]) {
    dcmd(banklogin,5,cmdtext);
    dcmd(bankregister,8,cmdtext);


    return 0;
    }



    public OnPlayerConnect(playerid) {
    tries[playerid] = 0;
    PLAYERLIST_authed[playerid]=false;
    if (udb_Exists(PlayerName(playerid))) return SendClientMessage(playerid, COLOR_BLUE, "Wilkommen zurück,(/banklogin password)");
    return false;


    }
    public OnPlayerDisconnect(playerid) {
    if (PLAYERLIST_authed[playerid]) {
    // save
    dUserSetINT(PlayerName(playerid)).("Money",GetPlayerMoney(playerid));
    }
    PLAYERLIST_authed[playerid]=false;
    return false;
    }






    kan jemd helfen ??


    C:\DOKUME~1\Marcel\Desktop\Sever\FILTER~1\bank.pwn(109) : error 017: undefined symbol "bank2"
    C:\DOKUME~1\Marcel\Desktop\Sever\FILTER~1\bank.pwn(109) : warning 215: expression has no effect
    C:\DOKUME~1\Marcel\Desktop\Sever\FILTER~1\bank.pwn(109) : error 001: expected token: ";", but found "]"
    C:\DOKUME~1\Marcel\Desktop\Sever\FILTER~1\bank.pwn(109) : error 029: invalid expression, assumed zero
    C:\DOKUME~1\Marcel\Desktop\Sever\FILTER~1\bank.pwn(109) : fatal error 107: too many error messages on one line
    Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


    4 Errors.


    DMA dat geht net: so doch oder wie meintest das?



    #include <a_samp>


    #define COLOR_WHITE 0xFFFFFFAA
    #define COLOR_YELLOW 0xFFFF00AA
    #include <dini>
    #include <dudb>

    forward SavedUpdate();
    new bank2[MAX_PLAYERS];



    public OnPlayerCommandText(playerid, cmdtext[])
    {
    new cmd[256];
    new idx;
    new bank2[MAX_PLAYERS];
    cmd = strtok(cmdtext, idx);
    if(strcmp(cmd, "/speichern", true) == 0 )
    {
    new tmp[256];
    new moneys;
    new string[256];
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_WHITE, "Benutzung: /speichern [Geldbetrag]");
    return 1;
    }
    moneys = strval(tmp);
    if(GetPlayerMoney(playerid) < moneys)
    {
    moneys = GetPlayerMoney(playerid);
    }
    GivePlayerMoney(playerid, 0-moneys);
    bank2[playerid]+=moneys;
    format(string, sizeof(string), "Du hast %d$ gespeichert, dein Kontostand lautet: %d$", moneys, bank2[playerid]);
    SendClientMessage(playerid, COLOR_YELLOW, string);
    return 1;
    }


    if(strcmp(cmd, "/abheben", true) == 0)
    {
    new string[256];
    new moneys;
    new tmp[256];
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_WHITE, "Benutzung: /abheben [Geldbetrag]");
    return 1;
    }
    moneys = strval(tmp);
    if(moneys > bank2[playerid])
    moneys = bank2[playerid];
    GivePlayerMoney(playerid, moneys);
    bank2[playerid] -= moneys;
    format(string, sizeof(string), "Du hast %d$ abgehoben, dein Kontostand lautet: %d$", moneys, bank2[playerid]);
    SendClientMessage(playerid, COLOR_YELLOW, string);
    return 1;
    }


    if(strcmp(cmd, "/konto", true) == 0)
    {
    new string[256];
    format(string, sizeof(string), "Dein Kontostand lautet: %d$", bank2[playerid]);
    SendClientMessage(playerid, COLOR_YELLOW, string);
    return 1;
    }
    return 0;
    }


    stock PlayerName(playerid)
    {
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, MAX_PLAYER_NAME);
    return name;
    }
    public OnPlayerConnect(playerid)
    {
    if (!udb_Exists(PlayerName(playerid)))
    {
    new fname[MAX_STRING];
    format(fname,sizeof(fname),"%s.sav",udb_encode(PlayerName(playerid)));
    dini_Create(fname);
    }
    if (udb_Exists(PlayerName(playerid)))
    {
    bank2[playerid]=dUserINT(PlayerName(playerid)).("bank");
    }
    return 1;
    }
    public SavedUpdate()
    {
    for (new i; i < MAX_PLAYERS; i++)
    {
    if (IsPlayerConnected(i))
    {
    dUserSetINT(PlayerName(i)).("bank",bank[i]);
    }
    }
    }




    #include <a_samp>



    #define COLOR_WHITE 0xFFFFFFAA
    #define COLOR_YELLOW 0xFFFF00AA
    #include <dini>
    #include <dudb>




    forward SavedUpdate();


    new bank[MAX_PLAYERS];








    public OnPlayerCommandText(playerid, cmdtext[])
    {
    new cmd[256];
    new idx;
    new bank[MAX_PLAYERS];


    cmd = strtok(cmdtext, idx);


    if(strcmp(cmd, "/speichern", true) == 0 )
    {
    new tmp[256];
    new moneys;
    new string[256];
    tmp = strtok(cmdtext, idx);


    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_WHITE, "Benutzung: /speichern [Geldbetrag]");
    return 1;
    }
    moneys = strval(tmp);
    if(GetPlayerMoney(playerid) < moneys)
    {
    moneys = GetPlayerMoney(playerid);
    }
    GivePlayerMoney(playerid, 0-moneys);
    bank[playerid]+=moneys;
    format(string, sizeof(string), "Du hast %d$ gespeichert, dein Kontostand lautet: %d$", moneys, bank[playerid]);
    SendClientMessage(playerid, COLOR_YELLOW, string);
    return 1;
    }



    if(strcmp(cmd, "/abheben", true) == 0)
    {
    new string[256];
    new moneys;
    new tmp[256];
    tmp = strtok(cmdtext, idx);


    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_WHITE, "Benutzung: /abheben [Geldbetrag]");
    return 1;
    }


    moneys = strval(tmp);


    if(moneys > bank[playerid])
    moneys = bank[playerid];


    GivePlayerMoney(playerid, moneys);
    bank[playerid] -= moneys;
    format(string, sizeof(string), "Du hast %d$ abgehoben, dein Kontostand lautet: %d$", moneys, bank[playerid]);
    SendClientMessage(playerid, COLOR_YELLOW, string);
    return 1;
    }



    if(strcmp(cmd, "/konto", true) == 0)
    {
    new string[256];
    format(string, sizeof(string), "Dein Kontostand lautet: %d$", bank[playerid]);
    SendClientMessage(playerid, COLOR_YELLOW, string);
    return 1;
    }
    return 0;
    }



    stock PlayerName(playerid)
    {
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, MAX_PLAYER_NAME);
    return name;
    }


    public OnPlayerConnect(playerid)
    {
    if (!udb_Exists(PlayerName(playerid)))
    {
    new fname[MAX_STRING];


    format(fname,sizeof(fname),"%s.sav",udb_encode(PlayerName(playerid)));
    dini_Create(fname);
    }
    if (udb_Exists(PlayerName(playerid)))
    {
    bank[playerid]=dUserINT(PlayerName(playerid)).("bank");
    }
    return 1;
    }


    public SavedUpdate()
    {
    for (new i; i < MAX_PLAYERS; i++)
    {
    if (IsPlayerConnected(i))
    {
    dUserSetINT(PlayerName(i)).("bank",bank);
    }
    }
    }





    das broblem ist der speichert das geld nicht mach kann bei /kont gucken und dann steht da imma 0


    ich hab nur eine warnung:



    C:\DOKUME~1\Marcel\Desktop\Sever\FILTER~1\bank.pwn(25) : warning 219: local variable "bank" shadows a variable at a preceding level
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


    1 Warning.


    ""kann ich den skript ändern so das auch geld gespeichert wird?




    UND WO MUSS ES HIN????????????????????????????????


    // Keiner in diesem Forum ist blind oder sehr sehgeschwächt sodass, du Schriftgröße 24 brauchst.
    // Man man man, kannst du nicht mal einen normal formulierten Beitrag schreiben?


    C:\Dokumente und Einstellungen\Marcel\Desktop\Sever\pawno\Untitled.pwn(55) : error 017: undefined symbol "dcmd_register"
    C:\Dokumente und Einstellungen\Marcel\Desktop\Sever\pawno\Untitled.pwn(58) : error 017: undefined symbol "params"
    C:\Dokumente und Einstellungen\Marcel\Desktop\Sever\pawno\Untitled.pwn(59) : error 017: undefined symbol "params"
    C:\Dokumente und Einstellungen\Marcel\Desktop\Sever\pawno\Untitled.pwn(72) : warning 225: unreachable code
    C:\Dokumente und Einstellungen\Marcel\Desktop\Sever\pawno\Untitled.pwn(72) : error 017: undefined symbol "dcmd_login"
    C:\Dokumente und Einstellungen\Marcel\Desktop\Sever\pawno\Untitled.pwn(75) : error 017: undefined symbol "params"
    C:\Dokumente und Einstellungen\Marcel\Desktop\Sever\pawno\Untitled.pwn(76) : error 017: undefined symbol "params"
    C:\Dokumente und Einstellungen\Marcel\Desktop\Sever\pawno\Untitled.pwn(83) : warning 217: loose indentation
    C:\Dokumente und Einstellungen\Marcel\Desktop\Sever\pawno\Untitled.pwn(85) : warning 225: unreachable code
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


    6 Errors.



    #include <a_samp>
    // This is a comment
    // uncomment the line below if you want to write a filterscript
    //#define FILTERSCRIPT
    #if defined FILTERSCRIPT
    public OnFilterScriptInit()
    {
    print("\n--------------------------------------");
    print(" Blank Filterscript by your name here");
    print("--------------------------------------\n");
    return 1;
    }
    public OnFilterScriptExit()
    {
    return 1;
    }
    #else


    #define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
    main()
    {
    print("\n----------------------------------");
    print(" Blank Gamemode by your name here");
    print("----------------------------------\n");
    }
    #endif
    #include <dini>
    #include <dutils>
    #include <dudb>
    #define COLOR_GREEN 0xFFFFFFAA
    #define COLOR_RED 0xFFFFFFAA
    new bool:PLAYERLIST_authed[MAX_PLAYERS];
    new spawned[MAX_PLAYERS];
    public OnGameModeInit()
    {
    // Don't use these lines if it's a filterscript
    SetGameModeText("Blank Script");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    return 1;
    }
    public OnGameModeExit()
    {
    return 1;
    }
    public OnPlayerRequestClass(playerid, classid)
    {
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    return 1;
    }


    public OnPlayerCommandText(playerid, cmdtext[])
    {
    dcmd_register(playerid,params[]) {
    if (PLAYERLIST_authed[playerid]) return SendClientMessage(playerid,COLOR_RED,"Du bist schon eingeloggt...");
    if (udb_Exists(PlayerName(playerid))) return SendClientMessage(playerid,COLOR_RED,"Dein Account Existiert bereits.");
    if (strlen(params)==0) return SendClientMessage(playerid,COLOR_RED,"[VERWENDUNG] /register [PASSWORT]");
    if (udb_Create(PlayerName(playerid),params)) {
    dUserSetINT(PlayerName(playerid)).("money",5000);
    dUserSetINT(PlayerName(playerid)).("ID",dUserINT("Server").("IDcount"));
    dUserSetINT(PlayerName(playerid)).("check",0);
    dUserSetFLOAT(PlayerName(playerid)).("health",100);
    printf("[REGISTRIERT] %s",PlayerName(playerid));
    new count = dUserINT("Server").("IDcount");
    count++;
    dUserSetINT("Server").("IDcount",count);
    return SendClientMessage(playerid,COLOR_GREEN,"Account Erfolgreich erstellt!");
    }
    return 1;
    }
    dcmd_login(playerid,params[]) {
    if (PLAYERLIST_authed[playerid]) return SendClientMessage(playerid,COLOR_RED,"Du bist schon eingeloggt...");
    if (!udb_Exists(PlayerName(playerid))) return SendClientMessage(playerid,COLOR_RED,"Account existiert nicht! [VERWENDUNG] /register [PASSWORT]");
    if (strlen(params)==0) return SendClientMessage(playerid,COLOR_RED,"[VERWENDUNG] /login [PASSWORT]");
    if (udb_CheckLogin(PlayerName(playerid),params)) {
    SpawnPlayer(playerid);
    GivePlayerMoney(playerid,dUserINT(PlayerName(playerid)).("money"));
    SetPlayerHealth(playerid,dUserFLOAT(PlayerName(playerid)).("health"));
    spawned[playerid] = 1;
    return SendClientMessage(playerid,COLOR_RED,"Du bist nun eingeloggt!");
    }
    return SendClientMessage(playerid,COLOR_RED,"Falsches Passwort!");
    }
    //ist das vllt. falsch
    if (PLAYERLIST_authed[playerid])
    {
    dUserSetINT(PlayerName(playerid)).("money",GetPlayerMoney(playerid));
    }
    //----------------------
    return 0;
    }


    stock PlayerName(playerid) {
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, MAX_PLAYER_NAME);
    return name;
    }