2x 12 Waren = 24 doch Sperre ab 20 Waren

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
  • Was ist darn falsch wenn ich 7stuff get 12 2x mal eingeb habe ich 24 Waren jedoch soll die Sperre ja bei 20 Liegen?


    if(strcmp(tmp,"get",true) == 0)
    {
    if(PlayerInfo[playerid][pBootsmann] >= 20)
    {
    SendClientMessage(playerid, COLOR_GRAD1, "Du hast schon 20 Waren dabei!");
    return 1;
    }
    if(IsPlayerInRangeOfPoint(playerid, 15.0, -1440.6125,390.9183,-0.0725))
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GOLD, "____________________________|Warenhilfe|____________________________");
    SendClientMessage(playerid, COLOR_WHITE, "Benutzung: /materials [Aktion] [Anzahl]");
    SendClientMessage(playerid, COLOR_WHITE, "Du hast die Anzahl vergessen");
    SendClientMessage(playerid, COLOR_GOLD,"__________________________________________________________________");
    return 1;
    }
    if(PlayerInfo[playerid][pBootsmann] <= 20)
    {
    if(PlayerInfo[playerid][pBootsmann] >= 20)
    {
    SendClientMessage(playerid, COLOR_GRAD1, "Du hast schon 20 Waren dabei!");
    return 1;
    }
    new message[128];
    new menge;
    new BootsmannJames = random(2);
    menge = strval(tmp);
    new preis = menge*100;
    if(menge < 1 || menge > 20) { SendClientMessage(playerid, COLOR_GREY, "Du kannst maximal 20 Pakete mitnehmen !"); return 1; }
    GivePlayerMoney(playerid,-preis);
    PlayerInfo[playerid][pBootsmann] += menge;
    format(message, sizeof(message), "* Du hast %d Materials Pakete für $%d gekauft.", menge, preis);
    SendClientMessage(playerid,WHITE,message);
    if(BootsmannJames == 1)
    {
    SetPlayerCheckpoint(playerid,-644.2157,861.9647,-0.1699,3.0);
    genaueAZ[playerid] = 1;
    CP1[playerid] = 1;
    SendClientMessage(playerid,WHITE,"Route 1");
    //genaueAZ[playerid] = 1;
    return 1;
    }
    if(BootsmannJames == 2)
    {
    SetPlayerCheckpoint(playerid,-854.0779,1380.6956,-0.1582,3.0);
    CP1[playerid] = 1;
    genaueAZ[playerid] = 1;
    SendClientMessage(playerid,WHITE,"Route 2");
    //genaueAZ[playerid] = 1;
    return 1;
    }
    /*if(BootsmannJames == 3)
    {
    SetPlayerCheckpoint(playerid,-1445.6111,1506.9808,-0.2445,3.0);
    CP1[playerid] = 1;
    SendClientMessage(playerid,WHITE,"Route 3");
    return 1;
    }
    if(BootsmannJames == 4)
    {
    SetPlayerCheckpoint(playerid,-2863.2322,1273.9257,-0.2789,3.0);
    CP1[playerid] = 1;
    SendClientMessage(playerid,WHITE,"Route 4");
    return 1;
    }*/
    return 1;
    }
    return 1;
    }
    else
    {
    SendClientMessage(playerid,WHITE,"Du bist nicht am Verladungsort nähe Flughafen! Checkpoint gestzt!");
    SetPlayerCheckpoint(playerid,-1440.6125,390.9183,-0.0725,3.0);
    return 1;
    }

    }

  • Probiers mal so ;)


    if(strcmp(tmp,"get",true) == 0)
    {
    if(PlayerInfo[playerid][pBootsmann] >= 20)
    {
    SendClientMessage(playerid, COLOR_GRAD1, "Du hast schon 20 Waren dabei!");
    return 1;
    }
    else
    if(IsPlayerInRangeOfPoint(playerid, 15.0, -1440.6125,390.9183,-0.0725))
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GOLD, "____________________________|Warenhilfe|____________________________");
    SendClientMessage(playerid, COLOR_WHITE, "Benutzung: /materials [Aktion] [Anzahl]");
    SendClientMessage(playerid, COLOR_WHITE, "Du hast die Anzahl vergessen");
    SendClientMessage(playerid, COLOR_GOLD,"__________________________________________________________________");
    return 1;
    }
    if(PlayerInfo[playerid][pBootsmann] <= 20)
    {
    if(PlayerInfo[playerid][pBootsmann] >= 20)
    {
    SendClientMessage(playerid, COLOR_GRAD1, "Du hast schon 20 Waren dabei!");
    return 1;
    }
    new message[128];
    new menge;
    new BootsmannJames = random(2);
    menge = strval(tmp);
    new preis = menge*100;
    if(menge < 1 || menge > 20) { SendClientMessage(playerid, COLOR_GREY, "Du kannst maximal 20 Pakete mitnehmen !"); return 1; }
    GivePlayerMoney(playerid,-preis);
    PlayerInfo[playerid][pBootsmann] += menge;
    format(message, sizeof(message), "* Du hast %d Materials Pakete für $%d gekauft.", menge, preis);
    SendClientMessage(playerid,WHITE,message);
    if(BootsmannJames == 1)
    {
    SetPlayerCheckpoint(playerid,-644.2157,861.9647,-0.1699,3.0);
    genaueAZ[playerid] = 1;
    CP1[playerid] = 1;
    SendClientMessage(playerid,WHITE,"Route 1");
    //genaueAZ[playerid] = 1;
    return 1;
    }
    if(BootsmannJames == 2)
    {
    SetPlayerCheckpoint(playerid,-854.0779,1380.6956,-0.1582,3.0);
    CP1[playerid] = 1;
    genaueAZ[playerid] = 1;
    SendClientMessage(playerid,WHITE,"Route 2");
    //genaueAZ[playerid] = 1;
    return 1;
    }
    /*if(BootsmannJames == 3)
    {
    SetPlayerCheckpoint(playerid,-1445.6111,1506.9808,-0.2445,3.0);
    CP1[playerid] = 1;
    SendClientMessage(playerid,WHITE,"Route 3");
    return 1;
    }
    if(BootsmannJames == 4)
    {
    SetPlayerCheckpoint(playerid,-2863.2322,1273.9257,-0.2789,3.0);
    CP1[playerid] = 1;
    SendClientMessage(playerid,WHITE,"Route 4");
    return 1;
    }*/
    return 1;
    }
    return 1;
    }
    else
    {
    SendClientMessage(playerid,WHITE,"Du bist nicht am Verladungsort nähe Flughafen! Checkpoint gestzt!");
    SetPlayerCheckpoint(playerid,-1440.6125,390.9183,-0.0725,3.0);
    return 1;
    }

    }

    Jens ralfts! Ich phillip gleich aus!