Problem mit /buyprods

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 Leute,
    hab mal wieder ein Problem. Bei funktioniert der Befehl /buyprods i-wie nicht ganz. Also wenn ich der Leader der Trucker Fraktion, /buyprods mache, steht da "Du bist kein Trucker ".
    Hier mal der Befehl:
    if(strcmp(cmd, "/buyprods", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if (PlayerInfo[playerid][pMember] != 20 || PlayerInfo[playerid][pLeader] != 20)
    {
    SendClientMessage(playerid,COLOR_GREY," Du bist kein Trucker!");
    return 1;
    }
    new tmpcar = GetPlayerVehicleID(playerid);
    new compcost = 100;
    if(PlayerToPoint(60.0, playerid, 1760.8212,-2057.1130,13.5870))
    {
    if(tmpcar)
    {
    if(PlayerHaul[tmpcar][pLoad] < PlayerHaul[tmpcar][pCapasity])
    {
    new amount;
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD1, "FEHLER: /buyprods [Menge]");
    return 1;
    }
    amount = strval(tmp);
    if(amount < 1 || amount > 100) { SendClientMessage(playerid, COLOR_GREY, " Die Menge muss zwischen 1 und 100 sein !"); return 1; }
    new check= PlayerHaul[tmpcar][pLoad] + amount;
    if(check > PlayerHaul[tmpcar][pCapasity])
    {
    format(string, sizeof(string), " Du hast das Limit mit %d Prods erreicht, Produkte: %d.",PlayerHaul[tmpcar][pCapasity],PlayerHaul[tmpcar][pLoad]);
    SendClientMessage(playerid, COLOR_GREY, string);
    return 1;
    }
    new cost = amount*compcost;
    if(GetPlayerMoney(playerid) >= cost)
    {
    PlayerHaul[tmpcar][pLoad] += amount;
    format(string, sizeof(string), "Produkte: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    format(string, sizeof(string), "Du hast %d Produkte für $%d gekauft.", amount,cost);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    GivePlayerMoney(playerid, -cost);
    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    return 1;
    }
    else
    {
    format(string, sizeof(string), "Du kannst nicht %d Produkte für $%d anfordern!", amount,cost);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    return 1;
    }
    }
    else
    {
    format(string, sizeof(string), "Produkte: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    return 1;
    }
    }
    else
    {
    SendClientMessage(playerid, TEAM_GROVE_COLOR, "Dieses Fahrzeug kann keine Produkte ausliefern.");
    return 1;
    }
    }
    }


    Hoffe Ihr könnt mir helfen


    MfG Joga

  • new tmpcar = GetPlayerVehicleID(playerid);



    wiso vehilce id? kapier ich jetzt nicht,
    bei
    if(check > PlayerHaul[tmpcar][pCapasity])



    musst doch gechekt werden ob das ein fahrzeug ist, hast du auch das fahzeug definiert oder so?

    526C4Hj.png Mit freundlichen Grüßen,
    Noneatme

  • Versuchs ma so (ich weiß ja nicht, ob man bei dir auch noch Member ist, wenn man Leader ist):
    if (PlayerInfo[playerid][pMember] != 20 && PlayerInfo[playerid][pLeader] != 20)
    {
    SendClientMessage(playerid,COLOR_GREY," Du bist kein Trucker!");
    return 1;
    }

  • Hab das Problem gelöst nur jetzt wenn ich im LKW drin bin und /load oder was anderes eingeben steht du bist nicht im lieferwagen. Heißt das ich muss in den Trucks /oldcar machen und die id´s ins script einfügen, oder was anderes ?


    MFG Joga

  • Ja was brauchste denn noch für codes ?


    //Habs hinbekommen, nur der /buyprods befehl geht noch nicht, da steht dieses fahrzeug kann keine Produkte ausliefern.
    if(strcmp(cmd, "/buyprods", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    new carid = GetPlayerVehicleID(playerid);
    new compcost = 50;
    if(PlayerToPoint(60.0, playerid, 1760.8212,-2057.1130,13.5870))
    {
    if(IsATruck(carid))
    {
    if(PlayerHaul[carid][pLoad] < PlayerHaul[carid][pCapasity])
    {
    new amount;
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD1, "FEHLER: /buyprods [Menge]");
    return 1;
    }
    amount = strval(tmp);
    if(amount < 1 || amount > 100) { SendClientMessage(playerid, COLOR_GREY, " Die Menge muss zwischen 1 und 100 sein !"); return 1; }
    new check= PlayerHaul[carid][pLoad] + amount;
    if(check > PlayerHaul[carid][pCapasity])
    {
    format(string, sizeof(string), " Du hast das Limit mit %d Prods erreicht, Produkte: %d.",PlayerHaul[carid][pCapasity],PlayerHaul[carid][pLoad]);
    SendClientMessage(playerid, COLOR_GREY, string);
    return 1;
    }
    new cost = amount*compcost;
    if(GetPlayerMoney(playerid) >= cost)
    {
    PlayerHaul[carid][pLoad] += amount;
    format(string, sizeof(string), "Produkte: %d/%d.", PlayerHaul[carid][pLoad],PlayerHaul[carid][pCapasity]);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    format(string, sizeof(string), "Du hast %d Produkte für $%d gekauft.", amount,cost);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    GivePlayerMoney(playerid, -cost);
    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    return 1;
    }
    else
    {
    format(string, sizeof(string), "Du kannst nicht %d Produkte für $%d anfordern!", amount,cost);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    return 1;
    }
    }
    else
    {
    format(string, sizeof(string), "Produkte: %d/%d.", PlayerHaul[carid][pLoad],PlayerHaul[carid][pCapasity]);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    return 1;
    }
    }
    else
    {
    SendClientMessage(playerid, TEAM_GROVE_COLOR, "Dieses Fahrzeug kann keine Produkte ausliefern.");
    return 1;
    }
    }
    }
    return 1;
    }


    MFG Joga

  • Also ich hab jetzt alles geändern. Es ist wieder ein Job nur jetzt hab ich das Problem das wenn ich /load oder /sellprods mache der Text kommt: Du musst in einem Lieferwagen sein. Bei /buyprods kommt immer Unknow Command.
    Hier die Befehle:
    if(strcmp(cmd, "/load", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    new carid = GetPlayerVehicleID(playerid);
    if(IsATruck(carid))
    {
    GameTextForPlayer(playerid, "~r~Du musst in einem Lieferwagen sein", 5000, 1);
    return 1;
    }
    format(string, sizeof(string), "Produkte: %d/%d.", PlayerHaul[carid][pLoad],PlayerHaul[carid][pCapasity]);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    }
    return 1;
    }
    if(strcmp(cmd, "/buyprods", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    new carid = GetPlayerVehicleID(playerid);
    new compcost = 50;
    if(PlayerToPoint(60.0, playerid, 1760.8212,-2057.1130,13.5870))
    {
    if(IsATruck(carid))
    {
    if(PlayerHaul[carid][pLoad] < PlayerHaul[carid][pCapasity])
    {
    new amount;
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD1, "FEHLER: /buyprods [Menge]");
    return 1;
    }
    amount = strval(tmp);
    if(amount < 1 || amount > 100) { SendClientMessage(playerid, COLOR_GREY, " Die Menge muss zwischen 1 und 100 sein !"); return 1; }
    new check= PlayerHaul[carid][pLoad] + amount;
    if(check > PlayerHaul[carid][pCapasity])
    {
    format(string, sizeof(string), " Du hast das Limit mit %d Prods erreicht, Produkte: %d.",PlayerHaul[carid][pCapasity],PlayerHaul[carid][pLoad]);
    SendClientMessage(playerid, COLOR_GREY, string);
    return 1;
    }
    new cost = amount*compcost;
    if(GetPlayerMoney(playerid) >= cost)
    {
    PlayerHaul[carid][pLoad] += amount;
    format(string, sizeof(string), "Produkte: %d/%d.", PlayerHaul[carid][pLoad],PlayerHaul[carid][pCapasity]);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    format(string, sizeof(string), "Du hast %d Produkte für $%d gekauft.", amount,cost);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    GivePlayerMoney(playerid, -cost);
    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    return 1;
    }
    else
    {
    format(string, sizeof(string), "Du kannst nicht %d Produkte für $%d anfordern!", amount,cost);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    return 1;
    }
    }
    else
    {
    format(string, sizeof(string), "Produkte: %d/%d.", PlayerHaul[carid][pLoad],PlayerHaul[carid][pCapasity]);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    return 1;
    }
    }
    else
    {
    SendClientMessage(playerid, TEAM_GROVE_COLOR, "Dieses Fahrzeug kann keine Produkte ausliefern.");
    return 1;
    }
    }
    }
    return 1;
    }
    if(strcmp(cmd, "/sellprods", true) == 0)
    {
    new cashmade;
    new carid;
    if(IsPlayerConnected(playerid))
    {
    carid = GetPlayerVehicleID(playerid);
    if(IsATruck(carid))
    {
    GameTextForPlayer(playerid, "~r~Du musst in einem Lieferwagen sein", 5000, 1);
    return 1;
    }
    if(PlayerHaul[carid][pLoad] == 0)
    {
    GameTextForPlayer(playerid, "~r~Lieferwagen ist leer!", 5000, 1);
    format(string, sizeof(string), "Produkte: %d/%d.", PlayerHaul[carid][pLoad],PlayerHaul[carid][pCapasity]);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    return 1;
    }
    for(new i = 0; i < sizeof(BizzInfo); i++)
    {
    if (PlayerToPoint(10, playerid,BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]))
    {
    //printf("Found House :%d",i);
    for(new l = PlayerHaul[carid][pLoad]; l > 0; l--)
    {
    if(BizzInfo[i][bProducts] == BizzInfo[i][bMaxProducts])
    {
    GameTextForPlayer(playerid, "~r~Unser Geschaeft ist voll", 5000, 1);
    format(string, sizeof(string), "Einnahme: $%d.", cashmade);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    format(string, sizeof(string), "Produkte: %d/%d.", PlayerHaul[carid][pLoad],PlayerHaul[carid][pCapasity]);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    return 1;
    }
    if(BizzInfo[i][bPriceProd] > BizzInfo[i][bTill])
    {
    GameTextForPlayer(playerid, "~r~Deal nicht möglich", 5000, 1);
    format(string, sizeof(string), "Einnahme: $%d.", cashmade);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    format(string, sizeof(string), "Produkte: %d/%d.", PlayerHaul[carid][pLoad],PlayerHaul[carid][pCapasity]);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    return 1;
    }
    PlayerHaul[carid][pLoad]--;
    BizzInfo[i][bProducts]++;
    cashmade = cashmade+BizzInfo[i][bPriceProd];
    ConsumingMoney[playerid] = 1;
    GivePlayerMoney(playerid,BizzInfo[i][bPriceProd]);
    BizzInfo[i][bTill] -= BizzInfo[i][bPriceProd];
    if(PlayerHaul[carid][pLoad] == 0)
    {
    GameTextForPlayer(playerid, "~r~Lieferwagen ist leer!", 5000, 1);
    format(string, sizeof(string), "Einnahme: $%d.", cashmade);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    format(string, sizeof(string), "Produkte: %d/%d.", PlayerHaul[carid][pLoad],PlayerHaul[carid][pCapasity]);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    return 1;
    }
    }
    OnPropUpdate();
    return 1;
    }
    }
    }


    Hoffe ihr könnt mir sagen was der Fehler ist. Danke


    MfG Joga

  • Kann mir da einer helfen ?


    //EDIT:Habs bisschen verändert geht trotzdem noch nicht -.-
    if(strcmp(cmd, "/load", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    new tmpcar = GetPlayerVehicleID(playerid);
    if(!IsATruck(tmpcar))
    {
    GameTextForPlayer(playerid, "~r~Du bist nicht im Truck", 5000, 1);
    return 1;
    }
    format(string, sizeof(string), "Products: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    }
    return 1;
    }
    if(strcmp(cmd, "/buyprods", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    new tmpcar = GetPlayerVehicleID(playerid);
    new compcost = 50;
    if(PlayerToPoint(60.0, playerid, 1760.8212,-2057.1130,13.5870))
    {
    if(!IsATruck(tmpcar))
    {
    if(PlayerHaul[tmpcar][pLoad] < PlayerHaul[tmpcar][pCapasity])
    {
    new amount;
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD1, "Benutze: /buyprods [Summe]");
    return 1;
    }
    amount = strval(tmp);
    if(amount < 1 || amount > 500) { SendClientMessage(playerid, COLOR_GREY, " Produktvergabe 1 - 500"); return 1; }
    new check= PlayerHaul[tmpcar][pLoad] + amount;
    if(check > PlayerHaul[tmpcar][pCapasity])
    {
    format(string, sizeof(string), " Du brichst das Limit %d, Momentane Produkte: %d.",PlayerHaul[tmpcar][pCapasity],PlayerHaul[tmpcar][pLoad]);
    SendClientMessage(playerid, COLOR_GREY, string);
    return 1;
    }
    new cost = amount*compcost;
    if(GetPlayerMoney(playerid) >= cost)
    {
    PlayerHaul[tmpcar][pLoad] += amount;
    // format(string, sizeof(string), "Produkte: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    format(string, sizeof(string), "Du kaufst %d Produkte Kosten: $%d.", amount,cost);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    GivePlayerMoney(playerid,cost);
    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    return 1;
    }
    else
    {
    format(string, sizeof(string), "You cant afford %d Products at $%d !", amount,cost);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    return 1;
    }
    }
    else
    {
    // format(string, sizeof(string), "Produkte: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    return 1;
    }
    }
    else
    {
    SendClientMessage(playerid, TEAM_GROVE_COLOR, " Dies ist kein Lieferwagen.");
    return 1;
    }
    }
    }
    return 1;
    }
    if(strcmp(cmd, "/sellprods", true) == 0)
    {
    new cashmade;
    new tmpcar;
    if(IsPlayerConnected(playerid))
    {
    tmpcar = GetPlayerVehicleID(playerid);
    if(!IsATruck(tmpcar))
    {
    GameTextForPlayer(playerid, "~r~Du bist nicht im Lieferwagen", 5000, 1);
    return 1;
    }
    if(PlayerHaul[tmpcar][pLoad] == 0)
    {
    GameTextForPlayer(playerid, "~r~Fahrzeug ist Leer", 5000, 1);
    // format(string, sizeof(string), "Produkte: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    return 1;
    }
    for(new i = 0; i < sizeof(BizzInfo); i++)
    {
    if (PlayerToPoint(10, playerid,BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]))
    {
    for(new l = PlayerHaul[tmpcar][pLoad]; l > 0; l--)
    {
    if(BizzInfo[i][bProducts] == BizzInfo[i][bMaxProducts])
    {
    GameTextForPlayer(playerid, "~r~Our stores are full", 5000, 1);
    format(string, sizeof(string), "Cash Earned $%d.", cashmade);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    format(string, sizeof(string), "Products: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    return 1;
    }
    if(BizzInfo[i][bPriceProd] > BizzInfo[i][bTill])
    {
    GameTextForPlayer(playerid, "~r~We Cant Afford The Deal", 5000, 1);
    format(string, sizeof(string), "Cash Earned $%d.", cashmade);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    format(string, sizeof(string), "Products: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    return 1;
    }
    PlayerHaul[tmpcar][pLoad]--;
    BizzInfo[i][bProducts]++;
    cashmade = cashmade+BizzInfo[i][bPriceProd];
    ConsumingMoney[playerid] = 1;
    GivePlayerMoney(playerid,BizzInfo[i][bPriceProd]);
    BizzInfo[i][bTill] -= BizzInfo[i][bPriceProd];
    if(PlayerHaul[tmpcar][pLoad] == 0)
    {
    GameTextForPlayer(playerid, "~r~Truck is empty, return to the stock house", 5000, 1);
    format(string, sizeof(string), "Cash Earned $%d.", cashmade);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    format(string, sizeof(string), "Products: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    return 1;
    }
    }
    OnPropUpdate();
    return 1;
    }
    }
    }
    blablabla



    MfG Joga

  • Habs geändert, jedoch steht da bei jeweils /sellprods und /load Unknow Command und bei /buyprods passiert einfach gar nichts.
    Hoffe ihr wisst was Falsch ist.


    Weiß niemand den Fehler ? ;(


    MfG Joga

  • Versuch mal die drei hier.


    if(strcmp(cmd, "/load", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    new tmpcar = GetPlayerVehicleID(playerid);
    if(!IsATruck(tmpcar))
    {
    GameTextForPlayer(playerid, "~r~Du bist nicht im Truck", 5000, 1);
    return 1;
    }
    format(string, sizeof(string), "Products: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    }
    return 1;
    }
    if(strcmp(cmd, "/buyprods", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    new tmpcar = GetPlayerVehicleID(playerid);
    new compcost = 50;
    if(PlayerToPoint(60.0, playerid, -53.3220,-1140.0674,1.0781))
    {
    if(!IsATruck(tmpcar))
    {
    if(PlayerHaul[tmpcar][pLoad] < PlayerHaul[tmpcar][pCapasity])
    {
    new amount;
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD1, "Benutze: /buyprods [Summe]");
    return 1;
    }
    amount = strval(tmp);
    if(amount < 1 || amount > 500) { SendClientMessage(playerid, COLOR_GREY, " Produktvergabe 1 - 500"); return 1; }
    new check= PlayerHaul[tmpcar][pLoad] + amount;
    if(check > PlayerHaul[tmpcar][pCapasity])
    {
    format(string, sizeof(string), " Du brichst das Limit %d, Momentane Produkte: %d.",PlayerHaul[tmpcar][pCapasity],PlayerHaul[tmpcar][pLoad]);
    SendClientMessage(playerid, COLOR_GREY, string);
    return 1;
    }
    new cost = amount*compcost;
    if(GetPlayerMoney(playerid) >= cost)
    {
    PlayerHaul[tmpcar][pLoad] += amount;
    // format(string, sizeof(string), "Produkte: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    format(string, sizeof(string), "Du kaufst %d Produkte Kosten: $%d.", amount,cost);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    PlayerMoney[playerid] -= cost;
    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    return 1;
    }
    else
    {
    format(string, sizeof(string), "You cant afford %d Products at $%d !", amount,cost);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    return 1;
    }
    }
    else
    {
    // format(string, sizeof(string), "Produkte: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    return 1;
    }
    }
    else
    {
    SendClientMessage(playerid, TEAM_GROVE_COLOR, " Dies ist kein Lieferwagen.");
    return 1;
    }
    }
    }
    return 1;
    }
    if(strcmp(cmd, "/sellprods", true) == 0)
    {
    new cashmade;
    new tmpcar;
    if(IsPlayerConnected(playerid))
    {
    tmpcar = GetPlayerVehicleID(playerid);
    if(!IsATruck(tmpcar))
    {
    GameTextForPlayer(playerid, "~r~Du bist nicht im Lieferwagen", 5000, 1);
    return 1;
    }
    if(PlayerHaul[tmpcar][pLoad] == 0)
    {
    GameTextForPlayer(playerid, "~r~Fahrzeug ist Leer", 5000, 1);
    // format(string, sizeof(string), "Produkte: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    return 1;
    }
    for(new i = 0; i < sizeof(BizzInfo); i++)
    {
    if (PlayerToPoint(10, playerid,BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]))
    {
    for(new l = PlayerHaul[tmpcar][pLoad]; l > 0; l--)
    {
    if(BizzInfo[i][bProducts] == BizzInfo[i][bMaxProducts])
    {
    GameTextForPlayer(playerid, "~r~Our stores are full", 5000, 1);
    format(string, sizeof(string), "Cash Earned $%d.", cashmade);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    format(string, sizeof(string), "Products: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    return 1;
    }
    if(BizzInfo[i][bPriceProd] > BizzInfo[i][bTill])
    {
    GameTextForPlayer(playerid, "~r~We Cant Afford The Deal", 5000, 1);
    format(string, sizeof(string), "Cash Earned $%d.", cashmade);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    format(string, sizeof(string), "Products: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    return 1;
    }
    PlayerHaul[tmpcar][pLoad]--;
    BizzInfo[i][bProducts]++;
    cashmade = cashmade+BizzInfo[i][bPriceProd];
    ConsumingMoney[playerid] = 1;
    PlayerMoney[playerid] += BizzInfo[i][bPriceProd];
    BizzInfo[i][bTill] -= BizzInfo[i][bPriceProd];
    if(PlayerHaul[tmpcar][pLoad] == 0)
    {
    GameTextForPlayer(playerid, "~r~Truck is empty, return to the stock house", 5000, 1);
    format(string, sizeof(string), "Cash Earned $%d.", cashmade);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    format(string, sizeof(string), "Products: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    return 1;
    }
    }
    OnPropUpdate();
    return 1;
    }
    }
    }
    for(new i = 0; i < sizeof(SBizzInfo); i++)
    {
    if (PlayerToPoint(10, playerid,SBizzInfo[i][sbEntranceX], SBizzInfo[i][sbEntranceY], SBizzInfo[i][sbEntranceZ]))
    {
    //printf("Found House :%d",i);
    for(new l = PlayerHaul[tmpcar][pLoad]; l > 0; l--)
    {
    if(SBizzInfo[i][sbProducts] == SBizzInfo[i][sbMaxProducts])
    {
    GameTextForPlayer(playerid, "~r~Our stores are full", 5000, 1);
    format(string, sizeof(string), "Cash Earned $%d.", cashmade);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    format(string, sizeof(string), "Products: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    return 1;
    }
    if(SBizzInfo[i][sbPriceProd] > SBizzInfo[i][sbTill])
    {
    GameTextForPlayer(playerid, "~r~We Cant Afford The Deal", 5000, 1);
    format(string, sizeof(string), "Cash Earned $%d.", cashmade);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    format(string, sizeof(string), "Products: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    return 1;
    }
    PlayerHaul[tmpcar][pLoad]--;
    SBizzInfo[i][sbProducts]++;
    cashmade = cashmade+SBizzInfo[i][sbPriceProd];
    ConsumingMoney[playerid] = 1;
    PlayerMoney[playerid] += SBizzInfo[i][sbPriceProd];
    SBizzInfo[i][sbTill] -= SBizzInfo[i][sbPriceProd];
    if(PlayerHaul[tmpcar][pLoad] == 0)
    {
    GameTextForPlayer(playerid, "~r~Truck is empty, return to the stock house", 5000, 1);
    format(string, sizeof(string), "Cash Earned $%d.", cashmade);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    format(string, sizeof(string), "Products: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    return 1;
    }
    }
    OnPropUpdate();
    return 1;
    }
    }
    GameTextForPlayer(playerid, "~r~To Far From A Business", 5000, 1);
    return 1;
    }

    GLOTZ MICH NICHT SO AN! ICH BIN AUCH NUR EINE SIGNATUR!!!

  • Dieser SERVER: Unknown COmmand kommt meistens, wenn man eine Arrygröße überschreitet, z.B. "new bla[20];" und dann in etwa so "bla[40]=55;"
    Und zu dem IsATruck, du müsstest mir dann immernoch mal die Frage beantworten, ob der mit AutoIDs oder ModelIDs läuft. Wenn es AutoIDs sind und due jetzt Fahrzeuge hinzufügt/entfernst verschiebt sich das natürlich alles