/edit befehl erstellen

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
  • Hallo Leute ich brauche mal eure Hilfe bei einem /edit befehl der Befehl soll ein Haus edieren können sprich das level preis usw.
    Habe noch nicht so eine Ahnung von Scripten... also weißt ich nicht ob es ein Haussystem hat wo ich es wendern einfügen könnte oder sonnst was...
    Mit freundlichen Grüßen
    [GFR]Eimchen

  • Hier von meinem Script, ist ein GF. Musst aber evtl. für dein Script abändern.


    if(strcmp(cmd, "/edit", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if(PlayerInfo[playerid][pAdmin] < 4)
    {
    SendClientMessage(playerid, COLOR_GRAD2, " Du bist nicht befugt !");
    return 1;
    }
    new x_job[256];
    x_job = strtok(cmdtext, idx);
    if(!strlen(x_job)) {
    SendClientMessage(playerid, COLOR_WHITE, "|__________________ Edit __________________|");
    SendClientMessage(playerid, COLOR_WHITE, "Benutze: /edit [Name] [Menge] (Für Häuser und Businesses)");
    SendClientMessage(playerid, COLOR_GREY, "Verfügbare Namen: Level, Price, Funds, Products");
    SendClientMessage(playerid, COLOR_WHITE, "|____________________________________________|");
    return 1;
    }
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "NUTZE: /edit [Name] [Menge]");
    return 1;
    }
    new proplev = strval(tmp);
    //if(strcmp(x_job,"car",true) == 0)
    for(new i = 0; i < sizeof(HouseInfo); i++)
    {
    if (IsPlayerInRangeOfPoint(playerid,3.0,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]))
    {
    format(string, sizeof(string), "Haus ID: %d", i);
    SendClientMessage(playerid, COLOR_GRAD2, string);
    if(proplev > 0)
    {
    if(strcmp(x_job,"level",true) == 0)
    {
    HouseInfo[i][hLevel] = proplev;
    }
    else if(strcmp(x_job,"price",true) == 0)
    {
    HouseInfo[i][hValue] = proplev;
    }
    }
    new string2[128];
    if(HouseInfo[i][hOwned] == 0)
    {
    format(string2, sizeof(string2), "[Haus zu verkaufen - %s]\nPreis: $%d\nLevel: %d\n/buyhouse zum kaufen",HouseInfo[i][hDiscription],HouseInfo[i][hValue],HouseInfo[i][hLevel]);
    Update3DTextLabelText(HouseInfo[i][Text],COLOR_FORSELL,string2);
    }
    else if(HouseInfo[i][hOwned] == 1 || HouseInfo[i][hRentabil] == 0)
    {
    format(string2, sizeof(string2), "[Haus]\nBesitzer: %s\nLevel: %d",HouseInfo[i][hOwner],HouseInfo[i][hLevel]);
    Update3DTextLabelText(HouseInfo[i][Text],COLOR_BUYED,string2);
    }
    else if(HouseInfo[i][hOwned] == 1 || HouseInfo[i][hRentabil] >= 1)
    {
    format(string2, sizeof(string2), "[Haus]\nBesitzer: %s\nLevel: %d\nMiete: $%d\nEinmieten mit /rentroom",HouseInfo[i][hOwner],HouseInfo[i][hLevel],HouseInfo[i][hRent]);
    Update3DTextLabelText(HouseInfo[i][Text],COLOR_BUYED,string2);
    }
    }
    }
    for(new i = 0; i < sizeof(BizzInfo); i++)
    {
    if (IsPlayerInRangeOfPoint(playerid,3.0,BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]))
    {
    format(string, sizeof(string), "Biz: %d", i);
    SendClientMessage(playerid, COLOR_GRAD2, string);
    if(proplev > 0)
    {
    if(strcmp(x_job,"level",true) == 0)
    {
    BizzInfo[i][bLevelNeeded] = proplev;
    }
    else if(strcmp(x_job,"price",true) == 0)
    {
    BizzInfo[i][bBuyPrice] = proplev;
    }
    else if(strcmp(x_job,"funds",true) == 0)
    {
    BizzInfo[i][bTill] = proplev;
    }
    else if(strcmp(x_job,"products",true) == 0)
    {
    BizzInfo[i][bProducts] = proplev;
    }
    }
    new string3[160];
    if(BizzInfo[i][bOwned] == 0)
    {
    format(string3, sizeof(string3), "[Business zu Verkaufen - %s]\nPreis: %d$\nLevel: %d", BizzInfo[i][bMessage],BizzInfo[i][bBuyPrice],BizzInfo[i][bLevelNeeded]);
    Update3DTextLabelText(BizzInfo[i][bText],COLOR_FORSELL,string3);
    }
    else if(BizzInfo[i][bOwned] == 1)
    {
    format(string3,
    sizeof(string3), "[%s]\nInhaber: %s\nTeilhaber: %s\nEintrittspreis:
    %d$\nLevel: %d\nProdukte: %d/%d\nPreis pro Produkt: %d", BizzInfo[i][bMessage],BizzInfo[i][bOwner],BizzInfo[i][bExtortion],BizzInfo[i][bEntranceCost],BizzInfo[i][bLevelNeeded],BizzInfo[i][bProducts],BizzInfo[i][bMaxProducts],BizzInfo[i][bPriceProd]);
    Update3DTextLabelText(BizzInfo[i][bText],COLOR_BUYED,string3);
    }
    }
    }
    for(new i = 0; i < sizeof(SBizzInfo); i++)
    {
    if (IsPlayerInRangeOfPoint(playerid,3.0,SBizzInfo[i][sbEntranceX], SBizzInfo[i][sbEntranceY], SBizzInfo[i][sbEntranceZ]))
    {
    format(string, sizeof(string), "SBiz: %d", i);
    SendClientMessage(playerid, COLOR_GRAD2, string);
    if(proplev > 0)
    {
    if(strcmp(x_job,"level",true) == 0)
    {
    SBizzInfo[i][sbLevelNeeded] = proplev;
    }
    else if(strcmp(x_job,"price",true) == 0)
    {
    SBizzInfo[i][sbBuyPrice] = proplev;
    }
    else if(strcmp(x_job,"funds",true) == 0)
    {
    SBizzInfo[i][sbTill] = proplev;
    }
    else if(strcmp(x_job,"products",true) == 0)
    {
    SBizzInfo[i][sbProducts] = proplev;
    }
    }
    new string4[160];
    if(SBizzInfo[i][sbOwned] == 0)
    {
    format(string4, sizeof(string4), "[Business zu Verkaufen - %s]\nPreis: %d$\nLevel: %d", SBizzInfo[i][sbMessage],SBizzInfo[i][sbBuyPrice],SBizzInfo[i][sbLevelNeeded]);
    Update3DTextLabelText(SBizzInfo[i][sbText],COLOR_FORSELL,string4);
    }
    else if(SBizzInfo[i][sbOwned] == 1)
    {
    format(string4,
    sizeof(string4), "[%s]\nInhaber: %s\nTeilhaber: %s\nEintrittspreis:
    %d$\nLevel: %d\nProdukte: %d/%d\nPreis pro Produkt: %d", SBizzInfo[i][sbMessage],SBizzInfo[i][sbOwner],SBizzInfo[i][sbExtortion],SBizzInfo[i][sbEntranceCost],SBizzInfo[i][sbLevelNeeded],SBizzInfo[i][sbProducts],SBizzInfo[i][sbMaxProducts], SBizzInfo[i][sbPriceProd]);
    Update3DTextLabelText(SBizzInfo[i][sbText],COLOR_BUYED,string4);
    }
    }
    }
    format(string, sizeof(string), "Du hast die/den %s eingestellt.", x_job);
    SendClientMessage(playerid, COLOR_WHITE, string);
    OnPropUpdate();
    }
    return 1;
    }
    [/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i]



    MfG,
    FabianLP!
    [/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i]

  • gehört das auch mit rein? 8|
    [/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/pwn][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i]

  • Bekomme die Errors


    Code
    if(strcmp(cmd, "/edit", true) == 0)


    Code
    x_job = strtok(cmdtext, idx);


    Code
    tmp = strtok(cmdtext, idx);


    Code
    if(!strlen(tmp))


    Code
    new proplev = strval(tmp);


    Code
    if (IsPlayerInRangeOfPoint(playerid,3.0,HouseInfo[hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]))


    Code
    format(string, sizeof(string), "Haus ID: %d", i);