Kack bug oder einfach auch nur ein denkfehler.. mit 2 komands

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
  • Hey leute,
    und zwa habe ich das problem, das wen ich /load oder /buyprods eingebe kommt bei mir immer unknow command..
    genau so ist es auch bei /sellbiz..


    bitte helft mir mal
    if(strcmp(cmd, "/buyprods", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    new tmpcar = GetPlayerVehicleID(playerid);
    new compcost = 50;
    if(PlayerToPoint(60.0, playerid, 2787.8,-2436.3,13.7))
    {
    if(IsATruck(tmpcar))
    {
    if(PlayerHaul[tmpcar][pLoad] < PlayerHaul[tmpcar][pCapasity])
    {
    new amount;
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD1, "Verwendung: /buyprods [betrag]");
    return 1;
    }
    amount = strval(tmp);
    if(amount < 1 || amount > 500) { SendClientMessage(playerid, COLOR_GREY, "Du kannst nicht weniger als 1 Produkt und mehr als 500 Produkte kaufen!"); return 1; }
    new check= PlayerHaul[tmpcar][pLoad] + amount;
    if(check > PlayerHaul[tmpcar][pCapasity])
    {
    format(string, sizeof(string), "Du bist über das Produktlimit von %d gegangen, du hast gerade %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 dir keine %d Produkte für %d$ kaufen!", 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 ist kein Lieferwagen.");
    return 1;
    }
    }
    }
    return 1;
    }

    Mein I-Net ^^

  • Also den bug hatte ich bei /renthouse auch aber das ist bei mir jetz gefixt du musst einfach den server neustarten wen das nicht hilft dan musst du im script einfach das einfügen ist zwar auf englisch kannst aber überstezen


    if(strcmp(cmd, "/buyprods", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    new tmpcar = GetPlayerVehicleID(playerid);
    new compcost = 20;
    if(PlayerToPoint(70.0, playerid, 2468.4919,-2092.9902,13.5469))
    {
    if(IsATruck(tmpcar))
    {
    if(PlayerHaul[tmpcar][pLoad] < PlayerHaul[tmpcar][pCapasity])
    {
    new amount;
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /buyprods [amount]");
    return 1;
    }
    amount = strval(tmp);
    if(amount < 1 || amount > 500) { SendClientMessage(playerid, COLOR_GREY, " Can't buy less then 1 Product or more then 500!"); return 1; }
    new check= PlayerHaul[tmpcar][pLoad] + amount;
    if(check > PlayerHaul[tmpcar][pCapasity])
    {
    format(string, sizeof(string), " You went over the Truck Products Carry Limit of %d, you currently carry %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), "Products: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    format(string, sizeof(string), "You bought %d Products for $%d.", amount,cost);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    SafeGivePlayerMoney(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), "Products: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    return 1;
    }
    }
    else
    {
    SendClientMessage(playerid, TEAM_GROVE_COLOR, "This Vehicle does not deliver Products.");
    return 1;
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, "You are not in trucker place.");
    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~You are not in a delivery truck", 5000, 1);
    return 1;
    }
    if(PlayerHaul[tmpcar][pLoad] == 0)
    {
    GameTextForPlayer(playerid, "~r~Truck is empty, return to the stock house", 5000, 1);
    format(string, sizeof(string), "Products: %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]))
    {
    //printf("Found House :%d",i);
    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;
    SafeGivePlayerMoney(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;
    SafeGivePlayerMoney(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;
    }

    Der Server: [GRG]Grand Racing Game wurde 2014 Eingestampft.
    Weitere Infos: Klick Mich

  • Du arbeitest mit dem GF nehme ich an?


    Hast du das neue Autos eingefügt oder welche gelöscht?
    Steht da "Tippe /buyprods um Produkte zu kaufen..." o.Ä. wenn du in das Auto einsteigst?
    Gibts Probleme mit anderen Autos (Taxi's, Reporter-Cars funktionieren nicht, etc.)?

  • Such nach PlayerHaul.
    Irgendwann triffst du dann auf diese Zeilen
    PlayerHaul[134][pCapasity] = 100;//134 = Vehicle ID
    PlayerHaul[135][pCapasity] = 100;
    PlayerHaul[136][pCapasity] = 50;
    PlayerHaul[137][pCapasity] = 50;


    Ändere die Vehicle IDs dann geht der cmd wieder