Bankproblem

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • Hi
    nun hab ich auch mal ne frage. Kriegs gerade einfach nicht raus.
    if(strcmp(cmd, "/bank", true) == 0 || strcmp(cmd, "/deposit", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if(PlayerInfo[playerid][pLocal] != 103 || PlayerToPoint(8.0, playerid, 1495.8094,-1749.6765,15.4453) || PlayerToPoint(3.0, playerid, 1210.5420,-915.5986,43.0301) || PlayerToPoint(3.0, playerid, 552.7684,-1293.7339,17.2482) || PlayerToPoint(3.0, playerid, -1980.8738,145.6721,27.6875))
    {
    SendClientMessage(playerid, COLOR_GREY, "Du bist nicht in der Bank !");
    }
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "BENUTZE: /bank [amount]");
    format(string, sizeof(string), "Du hast $%d auf deinem Konto.", PlayerInfo[playerid][pAccount]);
    SendClientMessage(playerid, COLOR_GRAD3, string);
    return 1;
    }
    new cashdeposit = strval(tmp);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "BENUTZE: /bank [amount]");
    format(string, sizeof(string), "Du hast $%d auf deinem Konto.", PlayerInfo[playerid][pAccount]);
    SendClientMessage(playerid, COLOR_GRAD3, string);
    return 1;
    }
    if (cashdeposit > GetPlayerMoney(playerid) || cashdeposit < 1)
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast nicht so viel");
    return 1;
    }
    GivePlayerMoney(playerid,-cashdeposit);
    new curfunds = PlayerInfo[playerid][pAccount];
    PlayerInfo[playerid][pAccount]=cashdeposit+PlayerInfo[playerid][pAccount];
    SendClientMessage(playerid, COLOR_WHITE, "|___ BANK STATMENT ___|");
    format(string, sizeof(string), " Alter Kontostand: $%d", curfunds);
    SendClientMessage(playerid, COLOR_GRAD2, string);
    format(string, sizeof(string), " Eingezahlt: $%d",cashdeposit);
    SendClientMessage(playerid, COLOR_GRAD4, string);
    SendClientMessage(playerid, COLOR_GRAD6, "|-----------------------------------------|");
    format(string, sizeof(string), " Neuer Kontostand: $%d", PlayerInfo[playerid][pAccount]);
    SendClientMessage(playerid, COLOR_WHITE, string);
    return 1;
    }
    return 1;
    }


    Er sagt wenn ich einen neuen Punkt hinzufüge, dass ich nicht in der Bank sei und ich kann es überall machen. Wollt Cashpoints machen und gleiche Commands nehmen klapopt net. Jemand ne Idee?

  • Zitat

    if(PlayerInfo[playerid][pLocal] != 103 || PlayerToPoint(8.0, playerid, 1495.8094,-1749.6765,15.4453) || PlayerToPoint(3.0, playerid, 1210.5420,-915.5986,43.0301) || PlayerToPoint(3.0, playerid, 552.7684,-1293.7339,17.2482) || PlayerToPoint(3.0, playerid, -1980.8738,145.6721,27.6875))
    {
    SendClientMessage(playerid, COLOR_GREY, "Du bist nicht in der Bank !");
    }

    ist eig logich das es nicht an den punkten geht ..weil er ja an den punkten das auslöst :
    SendClientMessage(playerid, COLOR_GREY, "Du bist nicht in der Bank !");


    du must davor ein ! machen vor den Playertoppoints

    „Auge um Auge - und die ganze Welt wird blind sein.“
    - Mahatma Gandhi

  • hab ich schon klappt aber nicht. Dann kann ichs überall machen.

  • if(PlayerInfo[playerid][pLocal] != 103 || !PlayerToPoint(8.0, playerid, 1495.8094,-1749.6765,15.4453) || !PlayerToPoint(3.0, playerid, 1210.5420,-915.5986,43.0301) || !PlayerToPoint(3.0, playerid, 552.7684,-1293.7339,17.2482) || !PlayerToPoint(3.0, playerid, -1980.8738,145.6721,27.6875))


    oder du machst es andersrumm ohne ! und
    if(PlayerInfo[playerid][pLocal] != 103 || PlayerToPoint(8.0, playerid, 1495.8094,-1749.6765,15.4453) || PlayerToPoint(3.0, playerid, 1210.5420,-915.5986,43.0301) || PlayerToPoint(3.0, playerid, 552.7684,-1293.7339,17.2482) || PlayerToPoint(3.0, playerid, -1980.8738,145.6721,27.6875))
    {
    SendClientMessage(playerid, COLOR_GREY, "Du bist nicht in der Bank !");
    }


    bei dem plocal nochn gleich und bei PlayerToPoint ohne ! und beziehst es auf den ganzen cmd

    Mfg. BlackFoX_UD_ alias [BFX]Explosion


  • Geht nicht. Kanns immernoch überall machen.
    if(strcmp(cmd, "/withdraw", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if(PlayerToPoint(8.0, playerid, 1210.5311,-915.5346,43.0301) || PlayerToPoint(3.0, playerid, 2308.6589,-13.2598,26.7422))
    {
    SendClientMessage(playerid, COLOR_GREY, "Du bist nicht in der Bank !");
    return 1;
    }
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "BENUTZE: /withdraw [amount]");
    format(string, sizeof(string), "Du hast $%d auf deinem Konto.", PlayerInfo[playerid][pAccount]);
    SendClientMessage(playerid, COLOR_GRAD3, string);
    return 1;
    }
    new cashdeposit = strval(tmp);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "BENUTZE: /withdraw [amount]");
    format(string, sizeof(string), "Du hast $%d auf deinem Konto.", PlayerInfo[playerid][pAccount]);
    SendClientMessage(playerid, COLOR_GRAD3, string);
    return 1;
    }
    if (cashdeposit > PlayerInfo[playerid][pAccount] || cashdeposit < 1)
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast nicht so viel !");
    return 1;
    }
    ConsumingMoney[playerid] = 1;
    GivePlayerMoney(playerid,cashdeposit);
    PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-cashdeposit;
    format(string, sizeof(string), "Du hast $%d von deinem Konto abgehoben. Total: $%d ", cashdeposit,PlayerInfo[playerid][pAccount]);
    SendClientMessage(playerid, COLOR_YELLOW, string);
    return 1;
    }
    return 1;
    }
    if(strcmp(cmd, "/bank", true) == 0 || strcmp(cmd, "/deposit", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if(PlayerInfo[playerid][pLocal] != 103 || PlayerToPoint(8.0, playerid, 1495.8094,-1749.6765,15.4453) || PlayerToPoint(3.0, playerid, 1210.5420,-915.5986,43.0301) || PlayerToPoint(3.0, playerid, 552.7684,-1293.7339,17.2482) || PlayerToPoint(3.0, playerid, -1980.8738,145.6721,27.6875))
    {
    SendClientMessage(playerid, COLOR_GREY, "Du bist nicht in der Bank !");
    }
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "BENUTZE: /bank [amount]");
    format(string, sizeof(string), "Du hast $%d auf deinem Konto.", PlayerInfo[playerid][pAccount]);
    SendClientMessage(playerid, COLOR_GRAD3, string);
    return 1;
    }
    new cashdeposit = strval(tmp);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "BENUTZE: /bank [amount]");
    format(string, sizeof(string), "Du hast $%d auf deinem Konto.", PlayerInfo[playerid][pAccount]);
    SendClientMessage(playerid, COLOR_GRAD3, string);
    return 1;
    }
    if (cashdeposit > GetPlayerMoney(playerid) || cashdeposit < 1)
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast nicht so viel");
    return 1;
    }
    GivePlayerMoney(playerid,-cashdeposit);
    new curfunds = PlayerInfo[playerid][pAccount];
    PlayerInfo[playerid][pAccount]=cashdeposit+PlayerInfo[playerid][pAccount];
    SendClientMessage(playerid, COLOR_WHITE, "|___ BANK STATMENT ___|");
    format(string, sizeof(string), " Alter Kontostand: $%d", curfunds);
    SendClientMessage(playerid, COLOR_GRAD2, string);
    format(string, sizeof(string), " Eingezahlt: $%d",cashdeposit);
    SendClientMessage(playerid, COLOR_GRAD4, string);
    SendClientMessage(playerid, COLOR_GRAD6, "|-----------------------------------------|");
    format(string, sizeof(string), " Neuer Kontostand: $%d", PlayerInfo[playerid][pAccount]);
    SendClientMessage(playerid, COLOR_WHITE, string);
    return 1;
    }
    return 1;
    }

  • Ich teste, aber danke schonmal.


    //edit:
    So geht immer noch nicht. Er sagt ich bin nicht am Bank / Cashpoint und ja ich stehe am richtigen Punkt.
    if(strcmp(cmd, "/withdraw", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if(PlayerInfo[playerid][pLocal] != 103 || !PlayerToPoint(8.0, playerid, 1495.7332,-1749.6750,15.4453) || !PlayerToPoint(8.0, playerid, -1980.8734,145.5074,27.6875) || !PlayerToPoint(8.0, playerid, 552.8599,-1293.7200,17.2482) || !PlayerToPoint(8.0, playerid, 1210.5317,-915.5406,43.0301) || !PlayerToPoint(8.0, playerid, 2308.7336,-13.2492,26.7422))
    {
    SendClientMessage(playerid, COLOR_GREY, "You are not at the Bank / Cashpoint !");
    return 1;
    }
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /withdraw [amount]");
    format(string, sizeof(string), " You Have $%d in your account.", PlayerInfo[playerid][pAccount]);
    SendClientMessage(playerid, COLOR_GRAD3, string);
    return 1;
    }
    new cashdeposit = strval(tmp);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /withdraw [amount]");
    format(string, sizeof(string), " You Have $%d in your account.", PlayerInfo[playerid][pAccount]);
    SendClientMessage(playerid, COLOR_GRAD3, string);
    return 1;
    }
    if (cashdeposit > PlayerInfo[playerid][pAccount] || cashdeposit < 1)
    {
    SendClientMessage(playerid, COLOR_GRAD2, " You dont have that much !");
    return 1;
    }
    ConsumingMoney[playerid] = 1;
    GivePlayerMoney(playerid,cashdeposit);
    PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-cashdeposit;
    format(string, sizeof(string), " You Have Withdrawn $%d from your account Total: $%d ", cashdeposit,PlayerInfo[playerid][pAccount]);
    SendClientMessage(playerid, COLOR_YELLOW, string);
    return 1;
    }
    return 1;
    }

    Einmal editiert, zuletzt von (Predator) ()

  • Ich hab genau das gleiche Problem. :thumbdown:
    Vllt hat ja einer ne Lösung. :)


    Greetz

    Greetz [Spirit]
    [font='Tahoma, Arial, Helvetica, sans-serif']


    [size=8]*** Ultimate GF RolePlay v0.5.0 ***
    *** Release & © by [Spirit] 2009 - 2011 ***
    *** Scriptstatus - |||||[color=#ff0000]|||||
    ***

  • mach das mit playertopoint und deine neuen punkte mal alles unter einnander und bei den neuen die du hinzugefügt hast vor diesem if immer ein else also so else if(PlayerToPoint


    also so


    if(strcmp(cmd, "/bank", true) == 0 || strcmp(cmd, "/deposit", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if(PlayerInfo[playerid][pLocal] != 103))
    else if (PlayerToPoint(8.0, playerid, 1495.8094,-1749.6765,15.4453)
    else if (PlayerToPoint(3.0, playerid, 1210.5420,-915.5986,43.0301)
    else if (PlayerToPoint(3.0, playerid, 552.7684,-1293.7339,17.2482)
    else if (PlayerToPoint(3.0, playerid, -1980.8738,145.6721,27.6875)
    {
    SendClientMessage(playerid, COLOR_GREY, "Du bist nicht in der Bank !");
    }
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "BENUTZE: /bank [amount]");
    format(string, sizeof(string), "Du hast $%d auf deinem Konto.", PlayerInfo[playerid][pAccount]);
    SendClientMessage(playerid, COLOR_GRAD3, string);
    return 1;
    }
    new cashdeposit = strval(tmp);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "BENUTZE: /bank [amount]");
    format(string, sizeof(string), "Du hast $%d auf deinem Konto.", PlayerInfo[playerid][pAccount]);
    SendClientMessage(playerid, COLOR_GRAD3, string);
    return 1;
    }
    if (cashdeposit > GetPlayerMoney(playerid) || cashdeposit < 1)
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast nicht so viel");
    return 1;
    }
    GivePlayerMoney(playerid,-cashdeposit);
    new curfunds = PlayerInfo[playerid][pAccount];
    PlayerInfo[playerid][pAccount]=cashdeposit+PlayerInfo[playerid][pAccount];
    SendClientMessage(playerid, COLOR_WHITE, "|___ BANK STATMENT ___|");
    format(string, sizeof(string), " Alter Kontostand: $%d", curfunds);
    SendClientMessage(playerid, COLOR_GRAD2, string);
    format(string, sizeof(string), " Eingezahlt: $%d",cashdeposit);
    SendClientMessage(playerid, COLOR_GRAD4, string);
    SendClientMessage(playerid, COLOR_GRAD6, "|-----------------------------------------|");
    format(string, sizeof(string), " Neuer Kontostand: $%d", PlayerInfo[playerid][pAccount]);
    SendClientMessage(playerid, COLOR_WHITE, string);
    return 1;
    }
    return 1;
    }

    RFT

    Einmal editiert, zuletzt von RFT ()

  • J:\Dokumente\Pawno, Script etc\Scripts\gf.pwn(10776) : error 029: invalid expression, assumed zero
    J:\Dokumente\Pawno, Script etc\Scripts\gf.pwn(10776) : warning 215: expression has no effect
    J:\Dokumente\Pawno, Script etc\Scripts\gf.pwn(10776) : error 001: expected token: ";", but found "if"
    J:\Dokumente\Pawno, Script etc\Scripts\gf.pwn(10777) : error 001: expected token: ")", but found "else"
    J:\Dokumente\Pawno, Script etc\Scripts\gf.pwn(10777) : error 029: invalid expression, assumed zero
    J:\Dokumente\Pawno, Script etc\Scripts\gf.pwn(10777) : warning 215: expression has no effect
    J:\Dokumente\Pawno, Script etc\Scripts\gf.pwn(10777) : error 001: expected token: ";", but found "if"
    J:\Dokumente\Pawno, Script etc\Scripts\gf.pwn(10777) : fatal error 107: too many error messages on one line


    Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    6 Errors.




    if(strcmp(cmd, "/bank", true) == 0 || strcmp(cmd, "/deposit", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if(PlayerInfo[playerid][pLocal] != 103)
    else if (!PlayerToPoint(8.0, playerid, 1495.8094,-1749.6765,15.4453)//hier
    else if (!PlayerToPoint(3.0, playerid, 1210.5420,-915.5986,43.0301)//hier
    else if (!PlayerToPoint(3.0, playerid, 552.7684,-1293.7339,17.2482)
    else if (!PlayerToPoint(3.0, playerid, -1980.8738,145.6721,27.6875)
    {
    SendClientMessage(playerid, COLOR_GREY, "Du bist nicht in der Bank !");
    }
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "BENUTZE: /bank [amount]");
    format(string, sizeof(string), "Du hast $%d auf deinem Konto.", PlayerInfo[playerid][pAccount]);
    SendClientMessage(playerid, COLOR_GRAD3, string);
    return 1;
    }
    new cashdeposit = strval(tmp);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "BENUTZE: /bank [amount]");
    format(string, sizeof(string), "Du hast $%d auf deinem Konto.", PlayerInfo[playerid][pAccount]);
    SendClientMessage(playerid, COLOR_GRAD3, string);
    return 1;
    }
    if (cashdeposit > GetPlayerMoney(playerid) || cashdeposit < 1)
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast nicht so viel");
    return 1;
    }
    GivePlayerMoney(playerid,-cashdeposit);
    new curfunds = PlayerInfo[playerid][pAccount];
    PlayerInfo[playerid][pAccount]=cashdeposit+PlayerInfo[playerid][pAccount];
    SendClientMessage(playerid, COLOR_WHITE, "|___ BANK STATMENT ___|");
    format(string, sizeof(string), " Alter Kontostand: $%d", curfunds);
    SendClientMessage(playerid, COLOR_GRAD2, string);
    format(string, sizeof(string), " Eingezahlt: $%d",cashdeposit);
    SendClientMessage(playerid, COLOR_GRAD4, string);
    SendClientMessage(playerid, COLOR_GRAD6, "|-----------------------------------------|");
    format(string, sizeof(string), " Neuer Kontostand: $%d", PlayerInfo[playerid][pAccount]);
    SendClientMessage(playerid, COLOR_WHITE, string);
    return 1;
    }
    return 1;
    }

  • IMmernoch Errors


    J:\Dokumente\Pawno, Script etc\Scripts\gf.pwn(10776) : error 029: invalid expression, assumed zero
    J:\Dokumente\Pawno, Script etc\Scripts\gf.pwn(10776) : warning 215: expression has no effect
    J:\Dokumente\Pawno, Script etc\Scripts\gf.pwn(10776) : error 001: expected token: ";", but found "if"
    J:\Dokumente\Pawno, Script etc\Scripts\gf.pwn(10776) : warning 217: loose indentation
    J:\Dokumente\Pawno, Script etc\Scripts\gf.pwn(10777) : error 029: invalid expression, assumed zero
    J:\Dokumente\Pawno, Script etc\Scripts\gf.pwn(10777) : warning 215: expression has no effect
    J:\Dokumente\Pawno, Script etc\Scripts\gf.pwn(10777) : error 001: expected token: ";", but found "if"
    J:\Dokumente\Pawno, Script etc\Scripts\gf.pwn(10778) : error 029: invalid expression, assumed zero
    J:\Dokumente\Pawno, Script etc\Scripts\gf.pwn(10778) : warning 215: expression has no effect
    J:\Dokumente\Pawno, Script etc\Scripts\gf.pwn(10778) : error 001: expected token: ";", but found "if"
    J:\Dokumente\Pawno, Script etc\Scripts\gf.pwn(10779) : error 029: invalid expression, assumed zero
    J:\Dokumente\Pawno, Script etc\Scripts\gf.pwn(10779) : warning 215: expression has no effect
    J:\Dokumente\Pawno, Script etc\Scripts\gf.pwn(10779) : error 001: expected token: ";", but found "if"
    J:\Dokumente\Pawno, Script etc\Scripts\gf.pwn(10783) : warning 217: loose indentation
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    8 Errors.

  • Hi, ich weiß, wenn man ein oder scriptet, und eine Nicht funktionien funktioniert das nicht, du musst die Funktion umkehren, "Prüfe ob er bei den Punkten steht, dann...., ansonst Message".


    Also hier:



    if(strcmp(cmd, "/bank", true) == 0 || strcmp(cmd, "/deposit", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if(PlayerInfo[playerid][pLocal] == 103 || PlayerToPoint(8.0, playerid, 1495.8094,-1749.6765,15.4453) || PlayerToPoint(3.0, playerid, 1210.5420,-915.5986,43.0301) || PlayerToPoint(3.0, playerid, 552.7684,-1293.7339,17.2482) || PlayerToPoint(3.0, playerid, -1980.8738,145.6721,27.6875))
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    { SendClientMessage(playerid, COLOR_GRAD2, "BENUTZE: /bank [amount]");
    format(string, sizeof(string), "Du hast $%d auf deinem Konto.", PlayerInfo[playerid][pAccount]);
    SendClientMessage(playerid, COLOR_GRAD3, string);
    return 1;
    }
    new cashdeposit = strval(tmp);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "BENUTZE: /bank [amount]");
    format(string, sizeof(string), "Du hast $%d auf deinem Konto.", PlayerInfo[playerid][pAccount]);
    SendClientMessage(playerid, COLOR_GRAD3, string);
    return 1;
    }
    if (cashdeposit > GetPlayerMoney(playerid) || cashdeposit < 1)
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast nicht so viel");
    return 1;
    }
    GivePlayerMoney(playerid,-cashdeposit);
    new curfunds = PlayerInfo[playerid][pAccount];
    PlayerInfo[playerid][pAccount]=cashdeposit+PlayerInfo[playerid][pAccount];
    SendClientMessage(playerid, COLOR_WHITE, "|___ BANK STATMENT ___|");
    format(string, sizeof(string), " Alter Kontostand: $%d", curfunds);
    SendClientMessage(playerid, COLOR_GRAD2, string);
    format(string, sizeof(string), " Eingezahlt: $%d",cashdeposit);
    SendClientMessage(playerid, COLOR_GRAD4, string);
    SendClientMessage(playerid, COLOR_GRAD6, "|-----------------------------------------|");
    format(string, sizeof(string), " Neuer Kontostand: $%d", PlayerInfo[playerid][pAccount]);
    SendClientMessage(playerid, COLOR_WHITE, string);
    return 1;
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, "Du bist nicht in der Bank !");
    }
    }
    return 1;
    }



    Mfg
    Grex

  • Kein Thema, habe mich auch am Anfagn gewundert, warum das nicht geht, ich weiß es jetzt noch nicht einmal warum das man bei einer Oderfunktion nicht zwei NEIN Funktionen verwenden kann....


    Bitte das Thema als gelöst markieren..., danke.