Makler Befehl

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 ich habe die Fraktion Makler gemacht und habe folgendes problem:


    if(strcmp(cmd, "/edit", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if(PlayerInfo[playerid][pAdmin] < 4 || PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)
    {
    SendClientMessage(playerid, COLOR_GRAD2, " Du bist kein Admin o0 !");
    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] [ammount] (Used for Houses and Businesses)");
    SendClientMessage(playerid, COLOR_GREY, "Available names: Level, Price, Funds, Products");
    SendClientMessage(playerid, COLOR_WHITE, "|____________________________________________|");
    return 1;
    }
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Benutze: /edit [name] [ammount]");
    return 1;
    }
    new proplev = strval(tmp);
    //if(strcmp(x_job,"car",true) == 0)
    for(new i = 0; i < sizeof(HouseInfo); i++)
    {
    if (PlayerToPoint(3, playerid,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]))
    {
    format(string, sizeof(string), "House: %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;
    }
    }
    }
    }
    for(new i = 0; i < sizeof(BizzInfo); i++)
    {
    if (PlayerToPoint(3, playerid,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;
    }
    }
    }
    }
    for(new i = 0; i < sizeof(SBizzInfo); i++)
    {
    if (PlayerToPoint(3, playerid,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;
    }
    }
    }
    }
    format(string, sizeof(string), "You've adjusted the: %s.", x_job);
    SendClientMessage(playerid, COLOR_WHITE, string);
    OnPropUpdate();
    }
    return 1;
    }


    wen ich ingame dan mit makler ohne admin z.B. /edit price 2 mache komm
    "" Du bist kein Admin o.O.""


    wie kann ich amchen das der makler diesen befehl ausführen kann?


    freu mcih auf eine antwort
    hover

  • hier



    if(strcmp(cmd, "/edit", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if(PlayerInfo[playerid][pAdmin] < 4 || PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)
    {
    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] [ammount] (Used for Houses and Businesses)");
    SendClientMessage(playerid, COLOR_GREY, "Available names: Level, Price, Funds, Products");
    SendClientMessage(playerid, COLOR_WHITE, "|____________________________________________|");
    return 1;
    }
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Benutze: /edit [name] [ammount]");
    return 1;
    }
    new proplev = strval(tmp);
    //if(strcmp(x_job,"car",true) == 0)
    for(new i = 0; i < sizeof(HouseInfo); i++)
    {
    if (PlayerToPoint(3, playerid,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]))
    {
    format(string, sizeof(string), "House: %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;
    }
    }
    }
    }
    for(new i = 0; i < sizeof(BizzInfo); i++)
    {
    if (PlayerToPoint(3, playerid,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;
    }
    }
    }
    }
    for(new i = 0; i < sizeof(SBizzInfo); i++)
    {
    if (PlayerToPoint(3, playerid,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;
    }
    }
    }
    }
    format(string, sizeof(string), "You've adjusted the: %s.", x_job);
    SendClientMessage(playerid, COLOR_WHITE, string);
    OnPropUpdate();
    }
    }
    else
    {
    SendClientMessage(playerid,COLOR_RED,"Du bist kein Admin");
    }
    return 1;
    }


    das er überprüft ob man Admin ist kannst du eigentlich weg lassen weil sonst wird das hier auch nicht gehen wendern musst du das mit else machen

    RFT

  • hier



    if(strcmp(cmd, "/edit", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if(PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)
    {
    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] [ammount] (Used for Houses and Businesses)");
    SendClientMessage(playerid, COLOR_GREY, "Available names: Level, Price, Funds, Products");
    SendClientMessage(playerid, COLOR_WHITE, "|____________________________________________|");
    return 1;
    }
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Benutze: /edit [name] [ammount]");
    return 1;
    }
    new proplev = strval(tmp);
    //if(strcmp(x_job,"car",true) == 0)
    for(new i = 0; i < sizeof(HouseInfo); i++)
    {
    if (PlayerToPoint(3, playerid,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]))
    {
    format(string, sizeof(string), "House: %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;
    }
    }
    }
    }
    for(new i = 0; i < sizeof(BizzInfo); i++)
    {
    if (PlayerToPoint(3, playerid,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;
    }
    }
    }
    }
    for(new i = 0; i < sizeof(SBizzInfo); i++)
    {
    if (PlayerToPoint(3, playerid,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;
    }
    }
    }
    }
    format(string, sizeof(string), "You've adjusted the: %s.", x_job);
    SendClientMessage(playerid, COLOR_WHITE, string);
    OnPropUpdate();
    }
    }
    else
    {
    SendClientMessage(playerid,COLOR_RED,"Du bist kein Admin");
    }
    return 1;
    }