Tresor befehle an einer bestimmten stelle

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 an alle. ich habe ein tresor für jede fagtion im script.


    Hier mal ein Befehl


    if(strcmp(cmd, "/fmats", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if(IsAMember(playerid))
    {
    new x;
    x = PlayerInfo[playerid][pMember] + PlayerInfo[playerid][pLeader];
    if(PlayerInfo[playerid][pRank] < 3)
    {
    SCM(playerid, COLOR_GREY, " You need to be Rank 3 or Higher for this action !");
    return 1;
    }
    /*if(DynamicFactions[x][fSafe] <= 0)
    {
    SCM(playerid, COLOR_WHITE, "The leader must buy a SAFE first !");
    return 1;
    }*/
    new x_nr[256];
    x_nr = strtok(cmdtext, idx);
    if(!strlen(x_nr))
    {
    if(PTP(5.0,playerid,DynamicFactions[x][fX],DynamicFactions[x][fY],DynamicFactions[x][fZ]))
    {
    format(string, sizeof(string), "Faction Mats: $%d.", DynamicFactions[x][fMats]);
    SCM(playerid, COLOR_WHITE, string);
    }
    SCM(playerid, COLOR_WHITE, "|________________________fMats_________________________|");
    SCM(playerid, COLOR_WHITE, "| USAGE: /fmats [name] [ammount]");
    SCM(playerid, COLOR_GREY, " | Available names: Take , Put");
    SCM(playerid, COLOR_WHITE, "|______________________________________________________|");
    return 1;
    }
    GetPlayerName(playerid, sendername, sizeof(sendername));
    GetPlayerName(giveplayerid, playername, sizeof(playername));
    if(strcmp(x_nr,"take",true) == 0)
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SCM(playerid, COLOR_GREY, "[USAGE:] /fmats take [amount]");
    return 1;
    }
    new materialsdeposit = strval(tmp);
    if(!strlen(tmp))
    {
    SCM(playerid, COLOR_GREY, "[USAGE:] /fmats take [amount]");
    return 1;
    }
    if(PTP(5.0,playerid,DynamicFactions[x][fX],DynamicFactions[x][fY],DynamicFactions[x][fZ]))
    {
    if(materialsdeposit <=DynamicFactions[x][fMats])
    {
    PlayerInfo[playerid][pMats] += materialsdeposit;
    DynamicFactions[x][fMats]=DynamicFactions[x][fMats]-materialsdeposit;
    format(string, sizeof(string), "You have taken %d mats from the storage facility, Materials Total: %d ", materialsdeposit,DynamicFactions[x][fMats]);
    SCM(playerid, COLOR_LIGHTBLUE, string);
    format(string, sizeof(string), "%s has just taken %d mats from the faction storage facility.",sendername,materialsdeposit);
    SendFamilyMessage(x, TEAM_AZTECAS_COLOR, string);
    SaveDynamicFactions();
    return 1;
    }
    else
    {
    SCM(playerid, COLOR_GREY, "There isn't that much mats in storage!");
    }
    }
    else
    {
    SCM(playerid, COLOR_GREY , "You are not at the faction storage facility!");
    }
    }
    else if(strcmp(x_nr,"put",true) == 0)
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SCM(playerid, COLOR_GREY, "[USAGE:] /fmats put [amount]");
    return 1;
    }
    new materialsdeposit = strval(tmp);
    if(!strlen(tmp))
    {
    SCM(playerid, COLOR_GREY, "[USAGE:] /fmats put [amount]");
    return 1;
    }
    if(PTP(5.0,playerid,DynamicFactions[x][fX],DynamicFactions[x][fY],DynamicFactions[x][fZ]))
    {
    if(materialsdeposit <= PlayerInfo[playerid][pMats])
    {
    PlayerInfo[playerid][pMats] =PlayerInfo[playerid][pMats]-materialsdeposit;
    DynamicFactions[x][fMats] +=materialsdeposit;
    format(string, sizeof(string), "You putted %d mats from the storage facility, Materials Total: %d ", materialsdeposit,DynamicFactions[x][fMats]);
    SCM(playerid, COLOR_LIGHTBLUE, string);
    format(string, sizeof(string), "%s has just putted %d mats from the faction storage facility.",sendername,materialsdeposit);
    SendFamilyMessage(x, TEAM_AZTECAS_COLOR, string);
    SaveDynamicFactions();
    return 1;
    }
    else
    {
    SCM(playerid, COLOR_GREY, "You don't have that much mats on you!");
    }
    }
    else
    {
    SCM(playerid, COLOR_GREY, "You are not at the faction storage facility!");
    }
    }
    else
    {
    SCM(playerid, COLOR_GREY, "Unknown fMats name !");
    return 1;
    }
    }
    else
    {
    SCM(playerid, COLOR_GREY, "You are not a gang member !");
    return 1;
    }
    }
    return 1;
    }


    So nun zu meiner Frage, wie mache ich es das man einem bestimmten punkt stehen muss um denn befehl einzugeben??


    Ich bedanke mich schon mal bei euch um eure Hilfe

    WEGEN MEINER RECHTSCHREIBUNG MÖCHTE ICH MICH ENDSCHULDIGEN ICH BIN LEGASTENIGER!!!!!!!!!!!!!

    Einmal editiert, zuletzt von Gambit ()

  • so habe ich es jetzt eingefügt aber ändern tut sich nichts.


    if(strcmp(cmd, "/fmats", true) == 0)
    {
    if(IsPlayerInRangeOfPoint(playerid, 7.0, 960.9306,3.2409,1001.1558))//LCN Safe ///eingefügt
    {
    SendClientMessage(playerid,0xFFFFFFFF,"You are near the Stadium entrance!");///eingefügt
    }


    if(IsPlayerConnected(playerid))
    {
    if(IsAMember(playerid))
    {
    new x;
    x = PlayerInfo[playerid][pMember] + PlayerInfo[playerid][pLeader];
    if(PlayerInfo[playerid][pRank] < 3)
    {
    SCM(playerid, COLOR_GREY, " You need to be Rank 3 or Higher for this action !");
    return 1;
    }
    /*if(DynamicFactions[x][fSafe] <= 0)
    {
    SCM(playerid, COLOR_WHITE, "The leader must buy a SAFE first !");
    return 1;
    }*/
    new x_nr[256];
    x_nr = strtok(cmdtext, idx);
    if(!strlen(x_nr))
    {
    if(PTP(5.0,playerid,DynamicFactions[x][fX],DynamicFactions[x][fY],DynamicFactions[x][fZ]))
    {
    format(string, sizeof(string), "Faction Mats: $%d.", DynamicFactions[x][fMats]);
    SCM(playerid, COLOR_WHITE, string);
    }
    SCM(playerid, COLOR_WHITE, "|________________________fMats_________________________|");
    SCM(playerid, COLOR_WHITE, "| USAGE: /fmats [name] [ammount]");
    SCM(playerid, COLOR_GREY, " | Available names: Take , Put");
    SCM(playerid, COLOR_WHITE, "|______________________________________________________|");
    return 1;
    }
    GetPlayerName(playerid, sendername, sizeof(sendername));
    GetPlayerName(giveplayerid, playername, sizeof(playername));
    if(strcmp(x_nr,"take",true) == 0)
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SCM(playerid, COLOR_GREY, "[USAGE:] /fmats take [amount]");
    return 1;
    }
    new materialsdeposit = strval(tmp);
    if(!strlen(tmp))
    {
    SCM(playerid, COLOR_GREY, "[USAGE:] /fmats take [amount]");
    return 1;
    }
    if(PTP(5.0,playerid,DynamicFactions[x][fX],DynamicFactions[x][fY],DynamicFactions[x][fZ]))
    {
    if(materialsdeposit <=DynamicFactions[x][fMats])
    {
    PlayerInfo[playerid][pMats] += materialsdeposit;
    DynamicFactions[x][fMats]=DynamicFactions[x][fMats]-materialsdeposit;
    format(string, sizeof(string), "You have taken %d mats from the storage facility, Materials Total: %d ", materialsdeposit,DynamicFactions[x][fMats]);
    SCM(playerid, COLOR_LIGHTBLUE, string);
    format(string, sizeof(string), "%s has just taken %d mats from the faction storage facility.",sendername,materialsdeposit);
    SendFamilyMessage(x, TEAM_AZTECAS_COLOR, string);
    SaveDynamicFactions();
    return 1;
    }
    else
    {
    SCM(playerid, COLOR_GREY, "There isn't that much mats in storage!");
    }
    }
    else
    {
    SCM(playerid, COLOR_GREY , "You are not at the faction storage facility!");
    }
    }
    else if(strcmp(x_nr,"put",true) == 0)
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SCM(playerid, COLOR_GREY, "[USAGE:] /fmats put [amount]");
    return 1;
    }
    new materialsdeposit = strval(tmp);
    if(!strlen(tmp))
    {
    SCM(playerid, COLOR_GREY, "[USAGE:] /fmats put [amount]");
    return 1;
    }
    if(PTP(5.0,playerid,DynamicFactions[x][fX],DynamicFactions[x][fY],DynamicFactions[x][fZ]))
    {
    if(materialsdeposit <= PlayerInfo[playerid][pMats])
    {
    PlayerInfo[playerid][pMats] =PlayerInfo[playerid][pMats]-materialsdeposit;
    DynamicFactions[x][fMats] +=materialsdeposit;
    format(string, sizeof(string), "You putted %d mats from the storage facility, Materials Total: %d ", materialsdeposit,DynamicFactions[x][fMats]);
    SCM(playerid, COLOR_LIGHTBLUE, string);
    format(string, sizeof(string), "%s has just putted %d mats from the faction storage facility.",sendername,materialsdeposit);
    SendFamilyMessage(x, TEAM_AZTECAS_COLOR, string);
    SaveDynamicFactions();
    return 1;
    }
    else
    {
    SCM(playerid, COLOR_GREY, "You don't have that much mats on you!");
    }
    }
    else
    {
    SCM(playerid, COLOR_GREY, "You are not at the faction storage facility!");
    }
    }
    else
    {
    SCM(playerid, COLOR_GREY, "Unknown fMats name !");
    return 1;
    }
    }
    else
    {
    SCM(playerid, COLOR_GREY, "You are not a gang member !");
    return 1;
    }
    }
    return 1;
    }

    WEGEN MEINER RECHTSCHREIBUNG MÖCHTE ICH MICH ENDSCHULDIGEN ICH BIN LEGASTENIGER!!!!!!!!!!!!!