Problem mit /auf 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

  • if(strcmp(cmdtext,"/auf",true) == 0)
    {
    if(IsACop(playerid))
    {
    if(IsPlayerInRangeOfPoint(playerid,15,1546.90857, -1621.72498, 13.96790))
    {
    MoveObject(pdtor,1546.8785, -1619.0118, 13.9679,3);


    SetTimer("ClosePD1",5000,0);
    }
    if(IsPlayerInRangeOfPoint(playerid,15,1546.90198, -1629.61267, 13.96780))
    {
    MoveObject(pdtor2,1546.8741, -1634.5200, 13.9678,3);


    SetTimer("ClosePD2",5000,0);
    }
    if(IsPlayerInRangeOfPoint(playerid,15,1584.69629, -1638.06104, 12.53330))
    {
    MoveObject(pdtor3,1592.5903, -1638.0891, 12.5333,3);


    SetTimer("ClosePD3",5000,0);
    }
    if(IsPlayerInRangeOfPoint(playerid,15,246.31219, 72.37320, 1005.75000))
    {
    MoveObject(LSPD,246.31219, 72.37320, 1008.75000,3);


    SetTimer("CloseLSPD",5000,0);
    }
    if(IsPlayerInRangeOfPoint(playerid,15,239.6427, 119.4335, 1004.1807))
    {
    MoveObject(FBI,239.6427, 119.4335, 1008.1807,3);


    SetTimer("CloseFBII",5000,0);
    }
    if(IsPlayerInRangeOfPoint(playerid,15,253.1496, 109.4081, 1004.1807))
    {
    MoveObject(FBI1,253.1496, 109.4081, 1008.1807,3);


    SetTimer("CloseFBIII",5000,0);
    }
    //=== FBI
    if(IsPlayerInRangeOfPoint(playerid,15,-1572.20813, 658.65210, 6.85650))
    {
    MoveObject(FBITor,-1572.1999512,658.7999878,6.8000002+ 0.01,0.01, 0.0000000,0.0000000,270.0000000);


    SetTimer("CloseFBI",5000,0);
    }
    if(IsPlayerInRangeOfPoint(playerid,15,-1701.42346,687.67249,24.75240))
    {
    MoveObject(FBITor1,-1701.4350586,687.7000122,24.6600037 + 0.01,0.01,0.0000000,360.0000000,270.0000000);


    SetTimer("CloseFBI1",5000,0);
    }
    if(IsPlayerInRangeOfPoint(playerid,15,-1631.6999512,688.4000244,8.6999998))
    {
    MoveObject(FBITor2,-1631.6999512,688.4000244,8.6999998+4,2);


    SetTimer("CloseFBI2",5000,0);
    }
    if(IsPlayerInRangeOfPoint(playerid,15,2293.84814, 2497.77832, 4.96050))
    {
    MoveObject(LVPD,2293.8564, 2508.5781, 4.9605,3);


    SetTimer("CloseLVPD",5000,0);
    }
    if(IsPlayerInRangeOfPoint(playerid,15,2335.19678, 2444.08301, 7.23057))
    {
    MoveObject(LVPD1,2330.1665, 2435.3477, 7.2306,3);


    SetTimer("CloseLVPD1",5000,0);
    }
    if(IsPlayerInRangeOfPoint(playerid,15,2238.1999500,2454.1001000,10.6000000))
    {
    MoveObject(LVPD2,2238.1992200,2450.5000000,10.6000000 + 0.01,0.01,0.0000000,0.0000000,270.0000000);


    SetTimer("CloseLVPD2",5000,0);
    }
    }
    else if(IsPlayerInFrac(playerid,23))
    {
    if(IsPlayerInRangeOfPoint(playerid,15,2605.86426, 2303.02051, 12.59370))
    {
    MoveObject(Russen,2605.86426, 2303.02051, 4.59370,3);


    SetTimer("CloseRussen",5000,0);
    }
    }
    else if(IsPlayerInFrac(playerid,24))
    {
    if(IsPlayerInRangeOfPoint(playerid,15,2255.83301, 2032.57910, 10.54020))
    {
    MoveObject(Ordnungsamt,2255.83301, 2032.57910, 10.54020 +0.01,0.01,0.00,0.00,0.00);


    SetTimer("CloseOrdnungsamt",5000,0);
    }
    }
    else if(IsPlayerInFrac(playerid,9))
    {
    if(IsPlayerInRangeOfPoint(playerid,15,-302.49179, 1507.61230, 75.09130))
    {
    MoveObject(Newslv,-302.49179, 1507.61230, 75.09130 +0.01,0.01,0.00,0.00,0.00);


    SetTimer("CloseNewslv",5000,0);
    }
    }
    else if(IsPlayerInFrac(playerid,8))
    {
    if(IsPlayerInRangeOfPoint(playerid,15,1879.50000, 703.20599, 12.60000))
    {
    MoveObject(HitmanTor,1879.50000, 703.20599, 5.60000,3);


    SetTimer("CloseHitmanTor",5000,0);
    }
    }
    else if(IsPlayerInFrac(playerid,6))
    {
    if(IsPlayerInRangeOfPoint(playerid,15,2520.49219, 1827.21167, 11.52890))
    {
    MoveObject(Yakuza,2520.49219, 1827.21167, 3.52890,3);
    MoveObject(Yakuza1,2520.45361, 1819.25110, 3.52030,3);


    SetTimer("CloseYakuza",5000,0);
    }
    }
    else if(IsPlayerInFrac(playerid,5)) //Problem Hier
    {
    if(IsPlayerInRangeOfPoint(playerid,15,2107.46973, 1385.40234, 12.59370))
    {
    MoveObject(LCM,2107.46973, 1385.40234, 3.59370,3);
    SetTimer("CloseLCM",5000,0);
    }
    }
    else if(IsPlayerInFrac(playerid,5)) //Problem hier
    {
    if(IsPlayerInRangeOfPoint(playerid,15,2089.63452, 1433.21313, 12.59370))
    {
    MoveObject(LCM1,2089.63452, 1433.21313, 3.59370,3);
    SetTimer("CloseLCM1",5000,0);
    }
    }
    }



    Hallo ich kann jedes tor öffnen bei Fraktion 5 sind 2 tore 1 lässt sich öffnen das 2 nicht warum? ist alles richtig eingestellt...

  • Versuch mal folgendes...

    Code
    else if(IsPlayerInFrac(playerid,5)) {
        if(IsPlayerInRangeOfPoint(playerid,15,2107.46973, 1385.40234, 12.59370)) {
            MoveObject(LCM,2107.46973, 1385.40234, 3.59370,3);
            SetTimer("CloseLCM",5000,0);
        }
        if(IsPlayerInRangeOfPoint(playerid,15,2089.63452, 1433.21313, 12.59370)) {
            MoveObject(LCM1,2089.63452, 1433.21313, 3.59370,3);
            SetTimer("CloseLCM1",5000,0);
        }
    }

    lg

  • C:\Windows\Vss\German v1.1\German[Scripts]\German-Next-Era-Life---v2.5\German Next Era Life - v2.5\gamemodes\GNE.pwn(43363) : warning 209: function "ocmd_job" should return a value




    ocmd:job(playerid,params[])
    {
    if(IsPlayerInRangeOfPoint(playerid,2.0,362.1261,173.7344,1008.3828))
    {
    ShowMenuForPlayer(Stadthalle, playerid);
    FreezePlayer(playerid);
    return 1;
    }
    } //43363)


    Warum?

  • ocmd:job(playerid,params[])
    {
    if(IsPlayerInRangeOfPoint(playerid,2.0,362.1261,173.7344,1008.3828))
    {
    ShowMenuForPlayer(Stadthalle, playerid);
    FreezePlayer(playerid);
    return 1;
    }
    return 1;
    }


    Wenn der Spieler sonst nicht in der Nähe wäre, würde kein Wert zurück gegeben werden.

  • Du kannst es aber auch so schreiben:


    C
    ocmd:job(playerid,params[])
    {
    	if(!IsPlayerInRangeOfPoint(playerid,2.0,362.1261,173.7344,1008.3828))return 1;
    	ShowMenuForPlayer(Stadthalle, playerid);
    	FreezePlayer(playerid);
    	return 1;
    }


    Mit freundlichen Grüßen
    German_ScripterHD