/mv befehl mit abfrage fraktion ??

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
  • Moin Leute ,


    Ich wollt nur mal schnell fragen wo ich die if abfrage rein hauen soll für fraktione / oder ifisplayeradmin hab versucht aber dann gehen die tore nit mehr :P


    if(strcmp("/mv", cmdtext, true, 10) ==0)
    {
    if(isPlayerAnAdmin(playerid,5))

    if(IsPlayerInRangeOfPoint(playerid,12,322.19921875, -1183.099609375, 71.300003051758) //ANGELO TOR
    || IsPlayerInRangeOfPoint(playerid,12,275, 189.39999389648, 1008.9000244141)//LSPD TOR drine
    || IsPlayerInRangeOfPoint(playerid,4,255.599609375, 181.7998046875, 1002)//LSPD TOR drine
    || IsPlayerInRangeOfPoint(playerid,4,254.19999694824, 181.69999694824, 1002)//LSPD TOR DRINE
    || IsPlayerInRangeOfPoint(playerid,10, 1545.5, -1626.5999755859, 16.299999237061)//LSPD tor draußen
    || IsPlayerInRangeOfPoint(playerid,10, 1589.4000244141, -1638.1999511719, 14.5))//LSPD tor draußen garage
    {
    //[____________________Angelos Haus____________________]
    if(tGateopen == 0 && IsPlayerInRangeOfPoint(playerid,12,322.19921875, -1183.099609375, 71.300003051758))
    {
    MoveObject(tGate,322.19921875, -1183.099609375, 60.300003051758,3);
    tGateopen = 1;
    return 1;
    }
    else if(tGateopen == 1 && IsPlayerInRangeOfPoint(playerid,12,322.19921875, -1183.099609375, 71.300003051758))


    {
    MoveObject(tGate,322.19921875, -1183.099609375, 71.300003051758,3);
    tGateopen = 0;
    return 1;
    }
    //[____________________LSPD DRINE ____________________]
    if(lGateopen == 0 && IsPlayerInRangeOfPoint(playerid,12,275, 189.39999389648, 1008.9000244141))
    {
    MoveObject(lGate,275, 189.39999389648, 1000.9000244141,3);
    lGateopen = 1;
    return 1;
    }
    else if(lGateopen == 1 && IsPlayerInRangeOfPoint(playerid,12,275, 189.39999389648, 1008.9000244141))
    {
    MoveObject(lGate,275, 189.39999389648, 1008.9000244141,3);
    lGateopen = 0;
    return 1;
    }
    //[________________________________________________________]
    if(aGateopen == 0 && IsPlayerInRangeOfPoint(playerid,4,255.599609375, 181.7998046875, 1002))
    {
    MoveObject(aGate,255.599609375, 181.7998046875, 995,3);
    aGateopen = 1;
    return 1;
    }
    else if(aGateopen == 1 && IsPlayerInRangeOfPoint(playerid,4,255.599609375, 181.7998046875, 1002))
    {
    MoveObject(aGate,255.599609375, 181.7998046875, 1002,3);
    aGateopen = 0;
    return 1;
    }
    //[________________________________________________________]
    if(bGateopen == 0 && IsPlayerInRangeOfPoint(playerid,4,254.19999694824, 181.69999694824, 1002))
    {
    MoveObject(bGate,254.19999694824, 181.69999694824, 995,3);
    bGateopen = 1;
    return 1;
    }
    else if(bGateopen == 1 && IsPlayerInRangeOfPoint(playerid,4,254.19999694824, 181.69999694824, 1002))
    {
    MoveObject(bGate,254.19999694824, 181.69999694824, 1002,3);
    bGateopen = 0;
    return 1;
    }
    //[____________________LSPD DRaußen ____________________]
    if(cGateopen == 0 && IsPlayerInRangeOfPoint(playerid,10, 1545.5, -1626.5999755859, 16.299999237061))
    {
    MoveObject(cGate, 1545.5, -1626.5999755859, 4.299999237061,3);
    cGateopen = 1;
    return 1;
    }
    else if(cGateopen == 1 && IsPlayerInRangeOfPoint(playerid,10, 1545.5, -1626.5999755859, 16.299999237061))
    {
    MoveObject(cGate, 1545.5, -1626.5999755859, 16.299999237061,3);
    cGateopen = 0;
    return 1;
    }
    //[________________________________________________________]
    if(dGateopen == 0 && IsPlayerInRangeOfPoint(playerid,10, 1589.4000244141, -1638.1999511719, 14.5))
    {
    MoveObject(dGate, 1589.4000244141, -1638.1999511719, 4.5,3);
    dGateopen = 1;
    return 1;
    }
    else if(dGateopen == 1 && IsPlayerInRangeOfPoint(playerid,10, 1589.4000244141, -1638.1999511719, 14.5))
    {
    MoveObject(dGate, 1589.4000244141, -1638.1999511719, 14.5,3);
    dGateopen = 0;
    return 1;
    }




    }


    }


    Danke schon mal:)

  • was ich mich zum einen frage ist wieso du zweimal abfrägst ob er an dem punkt ist

    if(IsPlayerInRangeOfPoint(playerid,12,322.19921875, -1183.099609375, 71.300003051758) //ANGELO TOR
    || IsPlayerInRangeOfPoint(playerid,12,275, 189.39999389648, 1008.9000244141)//LSPD TOR drine
    || IsPlayerInRangeOfPoint(playerid,4,255.599609375, 181.7998046875, 1002)//LSPD TOR drine
    || IsPlayerInRangeOfPoint(playerid,4,254.19999694824, 181.69999694824, 1002)//LSPD TOR DRINE
    || IsPlayerInRangeOfPoint(playerid,10, 1545.5, -1626.5999755859, 16.299999237061)//LSPD tor draußen
    || IsPlayerInRangeOfPoint(playerid,10, 1589.4000244141, -1638.1999511719, 14.5))//LSPD tor draußen garage
    {
    //[____________________Angelos Haus____________________]
    if(tGateopen == 0 && IsPlayerInRangeOfPoint(playerid,12,322.19921875, -1183.099609375, 71.300003051758))
    {

    ist schon ziemlich unnötig.


    und probier mal was er aus gibt bei
    if(isPlayerAnAdmin(playerid,5))


    wenn du ganz unten ein }else{ return SendClientMessage(playerid,0xFFFFFFFF,"Du bist kein Admin");}
    weil dann siehst du auch solltest du den idialien welche du angibst nicht entsprechen wird ein output angeben

  • So, ich habe das gerade mal alles für dich gemacht :)


    Nimm meinen Befehl und ersetze ihn mit deinem:


    if(strcmp(cmdtext, "/mv", true) == 0)
    {
    if(!isPlayerAnAdmin(playerid,5)) return SendClientMessage(playerid, rot,"Du bist kein Admin !");;
    //[____________________Angelos Haus____________________]
    if(IsPlayerInRangeOfPoint(playerid,12,322.19921875, -1183.099609375, 71.300003051758))
    {
    if(tGateopen == 0)
    {
    MoveObject(tGate,322.19921875, -1183.099609375, 60.300003051758,3);
    tGateopen = 1;
    }
    else if(tGateopen == 1)
    {
    MoveObject(tGate,322.19921875, -1183.099609375, 71.300003051758,3);
    tGateopen = 0;
    }
    }
    //[____________________LSPD DRINE ____________________]
    else if(IsPlayerInRangeOfPoint(playerid,12,275, 189.39999389648, 1008.9000244141))
    {
    if(lGateopen == 0)
    {
    MoveObject(lGate,275, 189.39999389648, 1000.9000244141,3);
    lGateopen = 1;
    }
    else if(lGateopen == 1)
    {
    MoveObject(lGate,275, 189.39999389648, 1008.9000244141,3);
    lGateopen = 0;
    }
    }
    //[________________________________________________________]
    else if(IsPlayerInRangeOfPoint(playerid,4,255.599609375, 181.7998046875, 1002))
    {
    if(aGateopen == 0)
    {
    MoveObject(aGate,255.599609375, 181.7998046875, 995,3);
    aGateopen = 1;
    }
    else if(aGateopen == 1)
    {
    MoveObject(aGate,255.599609375, 181.7998046875, 1002,3);
    aGateopen = 0;
    }
    }
    //[________________________________________________________]
    else if(IsPlayerInRangeOfPoint(playerid,4,254.19999694824, 181.69999694824, 1002))
    {
    if(bGateopen == 0)
    {
    MoveObject(bGate,254.19999694824, 181.69999694824, 995,3);
    bGateopen = 1;
    }
    else if(bGateopen == 1))
    {
    MoveObject(bGate,254.19999694824, 181.69999694824, 1002,3);
    bGateopen = 0;
    }
    }
    //[____________________LSPD DRaußen ____________________]
    else if(IsPlayerInRangeOfPoint(playerid,10, 1545.5, -1626.5999755859, 16.299999237061))
    {
    if(cGateopen == 0)
    {
    MoveObject(cGate, 1545.5, -1626.5999755859, 4.299999237061,3);
    cGateopen = 1;
    }
    else if(cGateopen == 1)
    {
    MoveObject(cGate, 1545.5, -1626.5999755859, 16.299999237061,3);
    cGateopen = 0;
    }
    }
    //[________________________________________________________]
    else if(IsPlayerInRangeOfPoint(playerid,10, 1589.4000244141, -1638.1999511719, 14.5))
    {
    if(dGateopen == 0)
    {
    MoveObject(dGate, 1589.4000244141, -1638.1999511719, 4.5,3);
    dGateopen = 1;
    }
    else if(dGateopen == 1)
    {
    MoveObject(dGate, 1589.4000244141, -1638.1999511719, 14.5,3);
    dGateopen = 0;
    }
    }
    return 1;
    }


    So und nun du deiner Fraktion Frage:


    So macht man es:


    if(IsPlayerInRangeOfPoint(...))
    {//da runter kommt die Fraktion Frage
    if(PlayerInfo[playerid][pMember] != 4) return SendClientMessage(playerid, rot,"Du bist nicht in dieser Fraktion !");// 4 = die Fraktion


    Hoffe ich habe dir geholfen ;)


    mfg. :thumbup:

    ast2ufdyxkb1.png


    Leute, lernt scripten und versucht mal lieber etwas selber zu schreiben, als es aus einem GF zu kopieren. :S

  • if(PlayerInfo[playerid][pMember] != 1 || PlayerInfo[playerid][pMember] != 2) return SendClientMessage(playerid, rot,"Du bist nicht in dieser Fraktion !");// 1 & 2 = die Fraktionen
    Sollte so klappen eigentlich